From: Matthias Schmidt Date: Thu, 16 Apr 2015 16:03:45 +0000 (+0200) Subject: Fix validating label group name X-Git-Tag: 2.1.4~71 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=29d01d46b48e5cc83fe1d908182a33739e568a33;p=GitHub%2FWoltLab%2FWCF.git Fix validating label group name --- diff --git a/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl b/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl index 53e1a0e146..1b261b8d69 100644 --- a/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl @@ -59,8 +59,8 @@ {if $errorField == 'groupName'} - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} + {if $errorType == 'empty' || $errorType == 'multilingual'} + {lang}wcf.global.form.error.{@$errorType}{/lang} {else} {lang}wcf.acp.label.group.groupName.error.{@$errorType}{/lang} {/if} diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index 6cdbd91c68..76e012f3ac 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -134,18 +134,13 @@ class LabelGroupAddForm extends AbstractForm { parent::validate(); // validate group name - try { - if (!I18nHandler::getInstance()->validateValue('groupName')) { - if (I18nHandler::getInstance()->isPlainValue('groupName')) { - throw new UserInputException('groupName'); - } - else { - throw new UserInputException('groupName', 'multilingual'); - } + if (!I18nHandler::getInstance()->validateValue('groupName')) { + if (I18nHandler::getInstance()->isPlainValue('groupName')) { + throw new UserInputException('groupName'); + } + else { + throw new UserInputException('groupName', 'multilingual'); } - } - catch (UserInputException $e) { - $this->errorType[$e->getField()] = $e->getType(); } // validate object type relations