From 5125d811a9e8effd7e098906775e17b724e11fd7 Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 11 Apr 2020 06:43:40 +0200 Subject: Improves handling with LIKE and thus improving search. --- app/Libraries/Helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app') 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) { -- cgit v1.2.3