1
0
mirror of https://github.com/EGroupware/egroupware.git synced 2025-01-10 07:58:41 +01:00

Fix searching for a space gives database error

(To actually search for a space, use quotes)
This commit is contained in:
Nathan Gray 2014-03-11 18:26:40 +00:00
parent 3b49be6203
commit 612b5bf34f

View File

@ -1194,6 +1194,7 @@ class so_sql
*/ */
public function search2criteria($pattern,&$wildcard='',&$op='AND',$extra_col=null, $search_cols = array()) public function search2criteria($pattern,&$wildcard='',&$op='AND',$extra_col=null, $search_cols = array())
{ {
$pattern = trim($pattern);
// This function can get called multiple times. Make sure it doesn't re-process. // This function can get called multiple times. Make sure it doesn't re-process.
if (empty($pattern) || is_array($pattern)) return $pattern; if (empty($pattern) || is_array($pattern)) return $pattern;
if(strpos($pattern, 'CAST(COALESCE(') !== false) if(strpos($pattern, 'CAST(COALESCE(') !== false)
@ -1201,7 +1202,6 @@ class so_sql
return $pattern; return $pattern;
} }
$pattern = trim($pattern);
$criteria = array(); $criteria = array();
$filter = array(); $filter = array();
$columns = array(); $columns = array();