summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2020-04-11 06:43:40 +0200
committerhorus2020-04-11 06:43:40 +0200
commit5125d811a9e8effd7e098906775e17b724e11fd7 (patch)
treea8671cd167c76603ec7b2c084fbc8f861f55c4e7
parent4999fa77ef0156f791d29e294585fcd920212f79 (diff)
downloadcurious-5125d811a9e8effd7e098906775e17b724e11fd7.tar.gz
Improves handling with LIKE and thus improving search.
-rw-r--r--app/Libraries/Helper.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Libraries/Helper.php b/app/Libraries/Helper.php
index b0ecdfd..d85d216 100644
--- a/app/Libraries/Helper.php
+++ b/app/Libraries/Helper.php
@@ -7,7 +7,9 @@ class Helper {
public static function escapeLike($string){
$search = array('%', '_');
$replace = array('\%', '\_');
- return str_replace($search, $replace, $string);
+ $string = str_replace($search, $replace, $string);
+ $string = explode(" ", $string);
+ return implode("%", $string);
}
public static function formatTimestamp($timestamp) {