From bfde33f93e131da5e1c47d4e2c3e0c42fab1a3a2 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 17 Jun 2013 10:43:40 +0200 Subject: [PATCH] Fixes validation order in LabelAddForm::validate() --- .../files/lib/acp/form/LabelAddForm.class.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php index 01d173e379..9b45087b2f 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php @@ -111,6 +111,15 @@ class LabelAddForm extends AbstractForm { public function validate() { parent::validate(); + // validate group + if (!$this->groupID) { + throw new UserInputException('groupID'); + } + $groups = $this->labelGroupList->getObjects(); + if (!isset($groups[$this->groupID])) { + throw new UserInputException('groupID', 'notValid'); + } + // validate label if (!I18nHandler::getInstance()->validateValue('label')) { if (I18nHandler::getInstance()->isPlainValue('label')) { @@ -121,15 +130,7 @@ class LabelAddForm extends AbstractForm { } } - // validate group - if (!$this->groupID) { - throw new UserInputException('groupID'); - } - $groups = $this->labelGroupList->getObjects(); - if (!isset($groups[$this->groupID])) { - throw new UserInputException('groupID', 'notValid'); - } - + // validate class name if (empty($this->cssClassName)) { throw new UserInputException('cssClassName', 'empty'); } -- 2.20.1