mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 01:42:29 +02:00
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
This commit is contained in:
@@ -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();'));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user