Changeset 7487

Show
Ignore:
Timestamp:
10/30/10 00:33:52 (3 years ago)
Author:
plg
Message:

bug 1973 fixed: aboid SQL syntax error if the category id given in the URL is
unknown.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/2.1/comments.php

    r6909 r7487  
    106106{ 
    107107  check_input_parameter('cat', $_GET, false, PATTERN_ID); 
     108 
     109  $category_ids = get_subcat_ids(array($_GET['cat'])); 
     110  if (empty($category_id)) 
     111  { 
     112    $category_ids = array(-1); 
     113  } 
    108114   
    109115  $page['where_clauses'][] = 
    110     'category_id IN ('.implode(',', get_subcat_ids(array($_GET['cat']))).')'; 
     116    'category_id IN ('.implode(',', $category_ids).')'; 
    111117} 
    112118