From 783f4d0a78707c7707b281c57e4420657a7303e2 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Wed, 23 Jul 2025 22:34:37 +0200 Subject: [PATCH] SearchService.php: fix matchStrings not matching flags --- inc/Service/SearchService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/Service/SearchService.php b/inc/Service/SearchService.php index 1bfcf0f9..affca81c 100644 --- a/inc/Service/SearchService.php +++ b/inc/Service/SearchService.php @@ -138,7 +138,7 @@ class SearchService { private static function matchStrings(array $strings, array $fragments): array { return \array_filter($strings, function ($str) use ($fragments) { // Saves the last position. We use this to ensure the fragments are one after the other. - $last_ret = 0; + $last_ret = -1; foreach ($fragments as $fragment) { if ($last_ret + 1 > \strlen($fragment)) { // Cannot possibly match. @@ -147,7 +147,7 @@ class SearchService { $last_ret = \stripos($str, $fragment, $last_ret + 1); if ($last_ret === false) { - // Exclude flags that don't much even a single fragment. + // Exclude flags that don't match even a single fragment. return false; } }