Skip to content

Commit

Permalink
merge r7487 from branch 2.1 to trunk
Browse files Browse the repository at this point in the history
bug 1973 fixed: aboid SQL syntax error if the category id given in the URL is
unknown.



git-svn-id: http://piwigo.org/svn/trunk@7488 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Oct 29, 2010
1 parent ef746f5 commit 7aae3dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion comments.php
Expand Up @@ -105,9 +105,15 @@
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
Expand Down

0 comments on commit 7aae3dd

Please sign in to comment.