an other one: fix sql error if link-id (accidently) contains non-ascii chars

This commit is contained in:
Ralf Becker 2015-07-23 11:50:06 +00:00
parent d320439e1e
commit cc6460e8c0

View File

@ -303,20 +303,27 @@ class solink
} }
} }
$deleted = array(); $deleted = array();
foreach(self::$db->select(self::TABLE,'*',$where,__LINE__,__FILE__) as $row) try {
{ foreach(self::$db->select(self::TABLE,'*',$where,__LINE__,__FILE__) as $row)
$deleted[] = $row; {
$deleted[] = $row;
}
if($hold_for_purge)
{
self::$db->update(self::TABLE,array(
'deleted' => time(),
'link_lastmod' => time(),
), $where, __LINE__,__FILE__);
}
else
{
self::$db->delete(self::TABLE,$where,__LINE__,__FILE__);
}
} }
if($hold_for_purge) // catch Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (1267)
{ // caused by non-ascii chars compared with ascii field uid
self::$db->update(self::TABLE,array( catch(egw_exception_db $e) {
'deleted' => time(), _egw_log_exception($e);
'link_lastmod' => time(),
), $where, __LINE__,__FILE__);
}
else
{
self::$db->delete(self::TABLE,$where,__LINE__,__FILE__);
} }
return $deleted; return $deleted;