From 1a7bb81f746df594ce18aea4338db8d0999445a6 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 9 Oct 2013 18:51:17 +0200 Subject: [PATCH] Fixes nesting level validation during category creation --- .../files/lib/acp/form/AbstractCategoryAddForm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/acp/form/AbstractCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/AbstractCategoryAddForm.class.php index 80c7d613e6..23adf41c04 100644 --- a/wcfsetup/install/files/lib/acp/form/AbstractCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/AbstractCategoryAddForm.class.php @@ -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'); } } -- 2.20.1