diff --git a/src/Form/SiteSearchForm.php b/src/Form/SiteSearchForm.php index b034696..2e9a0e1 100644 --- a/src/Form/SiteSearchForm.php +++ b/src/Form/SiteSearchForm.php @@ -34,12 +34,13 @@ public function getResults($pageLength = null, $data = null) $keywords = $data['Search']; - $andProcessor = create_function('$matches', ' - return " +" . $matches[2] . " +" . $matches[4] . " "; - '); - $notProcessor = create_function('$matches', ' - return " -" . $matches[3]; - '); + $andProcessor = function ($matches) { + return " +" . $matches[2] . " +" . $matches[4] . " "; + }; + + $notProcessor = function ($matches) { + return " -" . $matches[3]; + }; $keywords = preg_replace_callback('/()("[^()"]+")( and )("[^"()]+")()/i', $andProcessor, $keywords); $keywords = preg_replace_callback('/(^| )([^() ]+)( and )([^ ()]+)( |$)/i', $andProcessor, $keywords);