diff options
| author | horus | 2020-04-11 06:43:40 +0200 |
|---|---|---|
| committer | horus | 2020-04-11 06:43:40 +0200 |
| commit | 5125d811a9e8effd7e098906775e17b724e11fd7 (patch) | |
| tree | a8671cd167c76603ec7b2c084fbc8f861f55c4e7 /app/Libraries/Helper.php | |
| parent | 4999fa77ef0156f791d29e294585fcd920212f79 (diff) | |
| download | curious-5125d811a9e8effd7e098906775e17b724e11fd7.tar.gz | |
Improves handling with LIKE and thus improving search.
Diffstat (limited to 'app/Libraries/Helper.php')
| -rw-r--r-- | app/Libraries/Helper.php | 4 |
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) { |
