mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Catch empty (null) descriptions. Which never happens.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
parent
0fe70dae17
commit
43a7544dd7
@ -55,7 +55,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf
|
|||||||
public function triggered(TransactionJournal $journal): bool
|
public function triggered(TransactionJournal $journal): bool
|
||||||
{
|
{
|
||||||
$search = strtolower($this->triggerValue);
|
$search = strtolower($this->triggerValue);
|
||||||
$source = strtolower($journal->description);
|
$source = strtolower($journal->description ?? '');
|
||||||
|
|
||||||
$strpos = strpos($source, $search);
|
$strpos = strpos($source, $search);
|
||||||
if (!($strpos === false)) {
|
if (!($strpos === false)) {
|
||||||
|
@ -53,7 +53,7 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface
|
|||||||
*/
|
*/
|
||||||
public function triggered(TransactionJournal $journal): bool
|
public function triggered(TransactionJournal $journal): bool
|
||||||
{
|
{
|
||||||
$description = strtolower($journal->description);
|
$description = strtolower($journal->description ?? '');
|
||||||
$descriptionLength = strlen($description);
|
$descriptionLength = strlen($description);
|
||||||
$search = strtolower($this->triggerValue);
|
$search = strtolower($this->triggerValue);
|
||||||
$searchLength = strlen($search);
|
$searchLength = strlen($search);
|
||||||
|
@ -53,7 +53,7 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface
|
|||||||
*/
|
*/
|
||||||
public function triggered(TransactionJournal $journal): bool
|
public function triggered(TransactionJournal $journal): bool
|
||||||
{
|
{
|
||||||
$description = strtolower($journal->description);
|
$description = strtolower($journal->description ?? '');
|
||||||
$search = strtolower($this->triggerValue);
|
$search = strtolower($this->triggerValue);
|
||||||
|
|
||||||
if ($description == $search) {
|
if ($description == $search) {
|
||||||
|
@ -53,7 +53,7 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac
|
|||||||
*/
|
*/
|
||||||
public function triggered(TransactionJournal $journal): bool
|
public function triggered(TransactionJournal $journal): bool
|
||||||
{
|
{
|
||||||
$description = strtolower($journal->description);
|
$description = strtolower($journal->description ?? '');
|
||||||
$search = strtolower($this->triggerValue);
|
$search = strtolower($this->triggerValue);
|
||||||
|
|
||||||
$part = substr($description, 0, strlen($search));
|
$part = substr($description, 0, strlen($search));
|
||||||
|
Loading…
Reference in New Issue
Block a user