Allow for cases where we have no where clause.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 1 Jan 2011 19:28:20 +0000 (14:28 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 1 Jan 2011 19:28:20 +0000 (14:28 -0500)
Fixes listing ALL galleries, regardless of permissions.

framework/Share/lib/Horde/Share/Sql/Hierarchical.php

index 50d35df..65f65da 100644 (file)
@@ -264,7 +264,7 @@ class Horde_Share_Sql_Hierarchical extends Horde_Share_Sql
         }
 
         if (empty($where_parent)) {
-            $criteria[$key] = $query . ' WHERE ' . $where;
+            $criteria[$key] = $query . (!empty($where) ? ' WHERE ' . $where : '');
         } else {
             if (!empty($where)) {
                 $criteria[$key] = $query . ' WHERE (' . $where . ') AND ' . $where_parent;