aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_category.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-03-24 20:22:43 +0000
committerplegall <plg@piwigo.org>2014-03-24 20:22:43 +0000
commitfa538207600d86fef436957aed6fec92851aa3ce (patch)
tree7b36ee9621bd22b7459b89771261c5d9dbe964b4 /include/functions_category.inc.php
parent6b5940c9e1bad826fce85670ed7b89ce96c8b81c (diff)
merge r27925 from branch 2.6 to trunk
bug 3057: avoid warnings and SQL crash when encountering inconsistent permissions + rewrite permissions consistancy check when setting albums to private status. git-svn-id: http://piwigo.org/svn/trunk@27926 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_category.inc.php')
-rw-r--r--include/functions_category.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index f22e529dd..74d3a077b 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -538,6 +538,15 @@ FROM '.CATEGORIES_TABLE.' as c
if ( !isset( $cat['id_uppercat'] ) )
continue;
+ // Piwigo before 2.5.3 may have generated inconsistent permissions, ie
+ // private album A1/A2 permitted to user U1 but private album A1 not
+ // permitted to U1.
+ //
+ // TODO 2.7: add an upgrade script to repair permissions and remove this
+ // test
+ if ( !isset($cats[ $cat['id_uppercat'] ]))
+ continue;
+
$parent = & $cats[ $cat['id_uppercat'] ];
$parent['nb_categories']++;