fix Scrutinizer bug: non-existing Api\Api\Db\Exception\InvalidSql and delete_list accepts array of list-ids, while check_list does not

This commit is contained in:
Ralf Becker 2016-08-28 12:14:29 +02:00
parent 52ca45a228
commit 6c6f9eae7a

View File

@ -1882,7 +1882,7 @@ class Contacts extends Contacts\Storage
if ($ret) unset(self::$list_cache[$ret]);
}
// catch sql error, as creating same name&owner list gives a sql error doublicate key
catch(Api\Db\Exception\InvalidSql $e) {
catch(Db\Exception\InvalidSql $e) {
unset($e); // not used
return false;
}
@ -1937,10 +1937,10 @@ class Contacts extends Contacts\Storage
*/
function delete_list($list)
{
if (!$this->check_list($list,Acl::DELETE)) return false;
foreach((array)$list as $l)
{
if (!$this->check_list($l, Acl::DELETE)) return false;
unset(self::$list_cache[$l]);
}