ignore SQL error "Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation '='" stalling mail for usernames with non-ascii chars

This commit is contained in:
ralf 2023-11-14 15:22:53 +02:00
parent e131e24cfa
commit 2f664b1d0a

View File

@ -140,12 +140,17 @@ class Sql extends Mail\Smtp
{
$account_id[] = $id;
}
foreach($this->db->select(self::TABLE, 'account_id', array(
'mail_type' => self::TYPE_ALIAS,
'mail_value' => $user,
), __LINE__, __FILE__, false, '', self::APP) as $row)
{
if (!in_array($row['account_id'], $account_id)) $account_id[] = $row['account_id'];
try {
foreach($this->db->select(self::TABLE, 'account_id', array(
'mail_type' => self::TYPE_ALIAS,
'mail_value' => $user,
), __LINE__, __FILE__, false, '', self::APP) as $row)
{
if (!in_array($row['account_id'], $account_id)) $account_id[] = $row['account_id'];
}
}
catch (Api\Db\Exception $e) {
_egw_log_exception($e); // happens if username contains a non-ascii char
}
//error_log(__METHOD__."('$user') account_id=".array2string($account_id));
}