aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2006-05-31 21:36:09 +0000
committerplegall <plg@piwigo.org>2006-05-31 21:36:09 +0000
commit7f2fa28c7ac7244a775f9d86534e52183533b14b (patch)
treef4d98fa3db9bfe0625b0d1a3aa80540848fa3216
parent59d2febb48fc1a8690d1385c8885433b639e3281 (diff)
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
-rw-r--r--feed.php2
-rw-r--r--include/functions_user.inc.php5
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);
}