From: Matthias Schmidt Date: Sun, 31 Jul 2016 16:14:03 +0000 (+0200) Subject: Fix validation of menu title and menu item title X-Git-Tag: 3.0.0_Beta_1~835 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9248708424bcac27673c24ba95337988c5bedd12;p=GitHub%2FWoltLab%2FWCF.git Fix validation of menu title and menu item title --- diff --git a/wcfsetup/install/files/acp/templates/menuAdd.tpl b/wcfsetup/install/files/acp/templates/menuAdd.tpl index a1eee9c64f..943fc33857 100644 --- a/wcfsetup/install/files/acp/templates/menuAdd.tpl +++ b/wcfsetup/install/files/acp/templates/menuAdd.tpl @@ -31,7 +31,7 @@ {if $errorField == 'title'} - {if $errorType == 'title' || $errorType == 'multilingual'} + {if $errorType == 'empty' || $errorType == 'multilingual'} {lang}wcf.global.form.error.{@$errorType}{/lang} {else} {lang}wcf.acp.menu.title.error.{@$errorType}{/lang} diff --git a/wcfsetup/install/files/acp/templates/menuItemAdd.tpl b/wcfsetup/install/files/acp/templates/menuItemAdd.tpl index 10ee12c06a..33e1eed008 100644 --- a/wcfsetup/install/files/acp/templates/menuItemAdd.tpl +++ b/wcfsetup/install/files/acp/templates/menuItemAdd.tpl @@ -69,8 +69,8 @@ {if $errorField == 'title'} - {if $errorType == 'multilingual'} - {lang}wcf.global.form.error.multilingual{/lang} + {if $errorType == 'empty' || $errorType == 'multilingual'} + {lang}wcf.global.form.error.{@$errorType}{/lang} {else} {lang}wcf.acp.menu.item.title.error.{$errorType}{/lang} {/if} diff --git a/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php index 7b60b8fa1d..3023d99b0f 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php @@ -202,7 +202,12 @@ class MenuItemAddForm extends AbstractForm { // validate page menu item name if (!I18nHandler::getInstance()->validateValue('title')) { - throw new UserInputException('title'); + if (I18nHandler::getInstance()->isPlainValue('title')) { + throw new UserInputException('title'); + } + else { + throw new UserInputException('title', 'multilingual'); + } } // validate parent menu item