mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 17:48:56 +01:00
* Admin: fix SQL error when search contains a non-ascii character
This commit is contained in:
parent
b3667c9a1d
commit
504e4ff725
@ -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