mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Admin: fix SQL error when search contains a non-ascii character
This commit is contained in:
parent
41127ab765
commit
b799107de5
@ -1249,6 +1249,10 @@ class so_sql
|
||||
$numeric_columns[] = $col;
|
||||
continue;
|
||||
}
|
||||
if ($this->db->Type == 'mysql' && $table_def['fd'][$col_name]['type'] === 'ascii' && !preg_match('/[\x80-\xFF]/', $_pattern))
|
||||
{
|
||||
continue; // will only give sql error
|
||||
}
|
||||
$columns[] = sprintf($this->db->capabilities[egw_db::CAPABILITY_CAST_AS_VARCHAR],"COALESCE($col,'')");
|
||||
}
|
||||
if($columns)
|
||||
|
@ -424,7 +424,10 @@ class accounts_sql
|
||||
if (!isset($GLOBALS['egw_setup']) || in_array(emailadmin_smtp_sql::TABLE, $this->db->table_names(true)))
|
||||
{
|
||||
$email_cols = array('coalesce('.$this->contacts_table.'.contact_email,'.emailadmin_smtp_sql::TABLE.'.mail_value) as email');
|
||||
$search_cols[] = emailadmin_smtp_sql::TABLE.'.mail_value';
|
||||
if ($this->db->Type == 'mysql' && !preg_match('/[\x80-\xFF]/', $param['query']))
|
||||
{
|
||||
$search_cols[] = emailadmin_smtp_sql::TABLE.'.mail_value';
|
||||
}
|
||||
$join .= ' LEFT JOIN '.emailadmin_smtp_sql::TABLE.' ON '.$this->table.'.account_id=-'.emailadmin_smtp_sql::TABLE.'.account_id AND mail_type='.emailadmin_smtp_sql::TYPE_ALIAS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user