From 7f2fa28c7ac7244a775f9d86534e52183533b14b Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 31 May 2006 21:36:09 +0000 Subject: bug 378 fixed: category_id can't be -1 because the field is an unsigned integer. git-svn-id: http://piwigo.org/svn/branches/branch-1_5@1330 68402e56-0260-453c-a942-63ccdbb3a9ee --- feed.php | 2 +- include/functions_user.inc.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/feed.php b/feed.php index 0fbb8ff83..ef4647907 100644 --- a/feed.php +++ b/feed.php @@ -307,7 +307,7 @@ $user['forbidden_categories'] = calculate_permissions($user['id'], $user['status']); if ('' == $user['forbidden_categories']) { - $user['forbidden_categories'] = '-1'; + $user['forbidden_categories'] = '0'; } list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 8c02f3324..eca9530cf 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -362,7 +362,10 @@ SELECT cat_id // at least, the list contains -1 values. This category does not exists so // where clauses such as "WHERE category_id NOT IN(-1)" will always be // true. - array_push($forbidden_array, '-1'); + if (count($forbidden_array) == 0) + { + array_push($forbidden_array, 0); + } return implode(',', $forbidden_array); } -- cgit v1.2.3