Refactor search string escaping to a helper function
[MAILPOET-3077]
This commit is contained in:
committed by
Veljko V
parent
cd5079efda
commit
d026517ed9
@@ -98,4 +98,8 @@ class Helpers {
|
||||
return trim($value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
public static function escapeSearch(string $search): string {
|
||||
return str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], trim($search)); // escape for 'LIKE'
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user