From 552fd7180ef653de60811e526a134875d063b709 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 7 Jan 2025 10:42:38 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1950 --- wire/core/DatabaseQuerySelectFulltext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wire/core/DatabaseQuerySelectFulltext.php b/wire/core/DatabaseQuerySelectFulltext.php index dc27e7c9..6394188c 100644 --- a/wire/core/DatabaseQuerySelectFulltext.php +++ b/wire/core/DatabaseQuerySelectFulltext.php @@ -1269,7 +1269,7 @@ class DatabaseQuerySelectFulltext extends Wire { if(strpos($likeValue, "'") !== false || strpos($likeValue, "’") !== false) { // match either straight or curly apostrophe - $likeValue = preg_replace('/[\'’]+/', '(\'|’)', $likeValue); + $likeValue = str_replace([ "'", "’" ], "('|’)", $likeValue); // if word ends with apostrophe then apostrophe is optional $likeValue = rtrim(str_replace("('|’) ", "('|’)? ", "$likeValue ")); }