]> BookStack Code Mirror - bookstack/blobdiff - app/Entity.php
Fixed single word quoted search terms
[bookstack] / app / Entity.php
index 1342c29971e8a1ec21d56c461a07c6dc2bc652d4..496d20a333fa1069cd7c1ac19491df94b3f82b29 100644 (file)
@@ -167,7 +167,8 @@ class Entity extends Ownable
             foreach ($terms as $key => $term) {
                 $term = htmlentities($term, ENT_QUOTES);
                 $term = preg_replace('/[+\-><\(\)~*\"@]+/', ' ', $term);
-                if (preg_match('/\s/', $term)) {
+                if (preg_match('/&quot;.*?&quot;/', $term)) {
+                    $term = str_replace('&quot;', '', $term);
                     $exactTerms[] = '%' . $term . '%';
                     $term = '"' . $term . '"';
                 } else {
@@ -206,5 +207,5 @@ class Entity extends Ownable
 
         return $search->orderBy($orderBy, 'desc');
     }
-    
+
 }