From: Michael J. Rubinsky Date: Mon, 17 Jan 2011 21:58:42 +0000 (-0500) Subject: Allow sqln driver to take an array of 'attribute' filters as well X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=07490de9d6c1845b3af1eb288bc9e6121be0d744;p=horde.git Allow sqln driver to take an array of 'attribute' filters as well --- diff --git a/framework/Share/lib/Horde/Share/Sqlng.php b/framework/Share/lib/Horde/Share/Sqlng.php index 9efc14b06..e729fd56e 100644 --- a/framework/Share/lib/Horde/Share/Sqlng.php +++ b/framework/Share/lib/Horde/Share/Sqlng.php @@ -339,7 +339,12 @@ class Horde_Share_Sqlng extends Horde_Share_Sql // Build attribute/key filter. $where = '(' . $where . ') '; foreach ($attributes as $key => $value) { - $where .= ' AND ' . $key . ' = ' . $this->_db->quote($value); + if (is_array($value)) { + $value = array_map(array($this->_db, 'quote'), $value); + $where .= ' AND ' . $key . ' IN (' . implode(', ', $value) . ')'; + } else { + $where .= ' AND ' . $key . ' = ' . $this->_db->quote($value); + } } } elseif (!empty($attributes)) { // Restrict to shares owned by the user specified in the