Make sure criteria is an array before checking for cat_id

This commit is contained in:
Nathan Gray 2010-06-28 14:11:20 +00:00
parent c8abf9eacc
commit d6c19145db

View File

@ -247,7 +247,7 @@ class addressbook_sql extends so_sql_cf
$owner = isset($filter['owner']) ? $filter['owner'] : (isset($criteria['owner']) ? $criteria['owner'] : null); $owner = isset($filter['owner']) ? $filter['owner'] : (isset($criteria['owner']) ? $criteria['owner'] : null);
// fix cat_id criteria to search in comma-separated multiple cats and return subcats // fix cat_id criteria to search in comma-separated multiple cats and return subcats
if (($cats = $criteria['cat_id'])) if (is_array($criteria) && ($cats = $criteria['cat_id']))
{ {
$criteria += $this->_cat_search($criteria['cat_id'],$not); $criteria += $this->_cat_search($criteria['cat_id'],$not);
unset($criteria['cat_id']); unset($criteria['cat_id']);