mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
* Admin: fix SQL error when searching in access rights popup (probably other places too)
This commit is contained in:
parent
08d75bc7ad
commit
4efe325cdf
@ -1230,10 +1230,6 @@ class so_sql
|
|||||||
{
|
{
|
||||||
$search_cols = $this->get_default_search_columns();
|
$search_cols = $this->get_default_search_columns();
|
||||||
}
|
}
|
||||||
if(!$search_cols)
|
|
||||||
{
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
// Concat all fields to be searched together, so the conditions operate across the whole record
|
// Concat all fields to be searched together, so the conditions operate across the whole record
|
||||||
foreach($search_cols as $col)
|
foreach($search_cols as $col)
|
||||||
{
|
{
|
||||||
@ -1249,15 +1245,15 @@ class so_sql
|
|||||||
$numeric_columns[] = $col;
|
$numeric_columns[] = $col;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($this->db->Type == 'mysql' && $table_def['fd'][$col_name]['type'] === 'ascii' && !preg_match('/[\x80-\xFF]/', $_pattern))
|
if ($this->db->Type == 'mysql' && $table_def['fd'][$col_name]['type'] === 'ascii' && preg_match('/[\x80-\xFF]/', $_pattern))
|
||||||
{
|
{
|
||||||
continue; // will only give sql error
|
continue; // will only give sql error
|
||||||
}
|
}
|
||||||
$columns[] = sprintf($this->db->capabilities[egw_db::CAPABILITY_CAST_AS_VARCHAR],"COALESCE($col,'')");
|
$columns[] = sprintf($this->db->capabilities[egw_db::CAPABILITY_CAST_AS_VARCHAR],"COALESCE($col,'')");
|
||||||
}
|
}
|
||||||
if($columns)
|
if(!$search_cols)
|
||||||
{
|
{
|
||||||
$columns = call_user_func_array(array($GLOBALS['egw']->db,'concat'),$columns);
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Break the search string into tokens
|
// Break the search string into tokens
|
||||||
@ -1317,7 +1313,8 @@ class so_sql
|
|||||||
$op = 'OR';
|
$op = 'OR';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$token_filter = " $columns " . $this->db->capabilities['case_insensitive_like'] . ' ' .
|
$token_filter = ' '.call_user_func_array(array($GLOBALS['egw']->db,'concat'),$columns).' '.
|
||||||
|
$this->db->capabilities['case_insensitive_like'] . ' ' .
|
||||||
$GLOBALS['egw']->db->quote($wildcard.str_replace(array('%','_','*','?'),array('\\%','\\_','%','_'),$token).$wildcard);
|
$GLOBALS['egw']->db->quote($wildcard.str_replace(array('%','_','*','?'),array('\\%','\\_','%','_'),$token).$wildcard);
|
||||||
|
|
||||||
// Compare numeric token as equality for numeric columns
|
// Compare numeric token as equality for numeric columns
|
||||||
|
Loading…
Reference in New Issue
Block a user