A longer search string will no longer partly match on account name!

This commit is contained in:
James Cole 2017-10-06 07:07:12 +02:00
parent e5514bc61a
commit 29e02ce31f
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -75,10 +75,11 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface
$searchLength = strlen($search);
// if the string to search for is longer than the account name,
// shorten the search string.
// it will never be in the account name.
if ($searchLength > $nameLength) {
$search = substr($search, ($nameLength * -1));
$searchLength = strlen($search);
Log::debug(sprintf('RuleTrigger FromAccountEnds for journal #%d: "%s" does not end with "%s", return false.', $journal->id, $name, $search));
return false;
}