"fix for postgres problem reported by Hertell <nabble.com-at-hertell.com>, sql error when you filter by a category with sub-cats"

This commit is contained in:
Ralf Becker 2007-12-13 16:04:34 +00:00
parent e72c783fd4
commit 483aa9a343

View File

@ -248,7 +248,7 @@ class socal
}
array_walk($cats,create_function('&$val,$key','$val = (int) $val;'));
$sql = '(cal_category'.(count($cats) > 1 ? ' IN ('.implode(',',$cats).')' : '='.$this->db->quote((int)$cat_id));
$sql = '(cal_category'.(count($cats) > 1 ? " IN ('".implode("','",$cats)."')" : '='.$this->db->quote((int)$cat_id));
foreach($cats as $cat)
{
$sql .= ' OR '.$this->db->concat("','",'cal_category',"','").' LIKE '.$this->db->quote('%,'.$cat.',%');