From dfaa903f3927e661534c49100c0d177a9b203a1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 15 Dec 2013 16:54:06 +0100 Subject: [PATCH] Validate userOnlineMarking --- wcfsetup/install/files/acp/templates/userGroupAdd.tpl | 2 +- wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php | 3 +++ wcfsetup/install/lang/de.xml | 1 + wcfsetup/install/lang/en.xml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl index a771e38ea3..736f69560b 100644 --- a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl @@ -103,7 +103,7 @@ {if $errorType.userOnlineMarking|isset} - {lang}wcf.acp.group.userOnlineMarking.error.{@$errorType.priority}{/lang} + {lang}wcf.acp.group.userOnlineMarking.error.{@$errorType.userOnlineMarking}{/lang} {/if} {lang}wcf.acp.group.userOnlineMarking.description{/lang} diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php index 3c225c93d7..9a5bf9d9e3 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php @@ -120,6 +120,9 @@ class UserGroupAddForm extends AbstractOptionListForm { if (!I18nHandler::getInstance()->validateValue('groupName')) { throw new UserInputException('groupName'); } + if (mb_strpos($this->userOnlineMarking, '%s') === false) { + throw new UserInputException('userOnlineMarking', 'notValid'); + } } catch (UserInputException $e) { $this->errorType[$e->getField()] = $e->getType(); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index ee256988fd..b9f1e1fb2f 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -346,6 +346,7 @@ <strong>%s</strong> stellt Mitglieder dieser Gruppe beispielsweise in Fettdruck dar.]]> + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 9bf7cb16e4..3e1599997a 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -345,6 +345,7 @@ Examples for medium ID detection: <strong>%s</strong> results in a bolder appearance.]]> + -- 2.20.1