aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-10-29 22:33:52 +0000
committerplegall <plg@piwigo.org>2010-10-29 22:33:52 +0000
commit542920d0f0b357e0587cb6e361c96e88c697b9b5 (patch)
tree3d334cb49d263509e626aa4f53484284b9120948
parent0b21183ce127157279deaffdc6f1816e4af3bdaa (diff)
bug 1973 fixed: aboid SQL syntax error if the category id given in the URL is
unknown. git-svn-id: http://piwigo.org/svn/branches/2.1@7487 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--comments.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/comments.php b/comments.php
index 0ffb05d97..78f3d011d 100644
--- a/comments.php
+++ b/comments.php
@@ -105,9 +105,15 @@ $page['where_clauses'] = array();
if (isset($_GET['cat']) and 0 != $_GET['cat'])
{
check_input_parameter('cat', $_GET, false, PATTERN_ID);
+
+ $category_ids = get_subcat_ids(array($_GET['cat']));
+ if (empty($category_id))
+ {
+ $category_ids = array(-1);
+ }
$page['where_clauses'][] =
- 'category_id IN ('.implode(',', get_subcat_ids(array($_GET['cat']))).')';
+ 'category_id IN ('.implode(',', $category_ids).')';
}
// search a particular author