Fixes nesting level validation during category creation
authorMatthias Schmidt <gravatronics@live.com>
Wed, 9 Oct 2013 16:51:17 +0000 (18:51 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 9 Oct 2013 16:51:17 +0000 (18:51 +0200)
wcfsetup/install/files/lib/acp/form/AbstractCategoryAddForm.class.php

index 80c7d613e69f15367b876a361a98a95aa8d85a9c..23adf41c042f7581236f609ab27170514eff2cc8 100644 (file)
@@ -336,7 +336,7 @@ abstract class AbstractCategoryAddForm extends AbstractForm {
                        }
                        
                        if ($this->objectType->getProcessor()->getMaximumNestingLevel() != -1) {
-                               if (count($category->getParentCategories()) > $this->objectType->getProcessor()->getMaximumNestingLevel()) {
+                               if (count($category->getParentCategories()) + 1 > $this->objectType->getProcessor()->getMaximumNestingLevel()) {
                                        throw new UserInputException('parentCategoryID', 'notValid');
                                }
                        }