From: esakkiraja100116 Date: Wed, 26 Apr 2023 16:49:16 +0000 (+0530) Subject: suggesstion issue fix (#4175) X-Git-Tag: v23.05~1^2~9^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/78fecdfcb0112a82f5e92533beb187e5fb5f29f3 suggesstion issue fix (#4175) --- diff --git a/app/Search/SearchRunner.php b/app/Search/SearchRunner.php index 013f7b380..d11dcde01 100644 --- a/app/Search/SearchRunner.php +++ b/app/Search/SearchRunner.php @@ -218,6 +218,7 @@ class SearchRunner $subQuery->where('entity_type', '=', $entity->getMorphClass()); $subQuery->where(function (Builder $query) use ($terms) { foreach ($terms as $inputTerm) { + $inputTerm = (strpos($inputTerm, "\\") !== false) ? str_replace("\\", "\\\\", $inputTerm) : $inputTerm; $query->orWhere('term', 'like', $inputTerm . '%'); } });