From: Marcel Werk Date: Sat, 27 Sep 2014 20:45:30 +0000 (+0200) Subject: Added censorship in 'about me' text X-Git-Tag: 2.1.0_Alpha_1~293 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=882f42adcfa640438974b10d1617c08e62aecbde;p=GitHub%2FWoltLab%2FWCF.git Added censorship in 'about me' text --- diff --git a/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php b/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php index e0a01f80f6..86b6ef1907 100644 --- a/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php @@ -2,6 +2,7 @@ namespace wcf\system\option; use wcf\data\option\Option; use wcf\system\exception\UserInputException; +use wcf\system\message\censorship\Censorship; use wcf\system\WCF; /** @@ -24,5 +25,14 @@ class AboutMeOptionType extends MessageOptionType { if (WCF::getSession()->getPermission('user.profile.aboutMeMaxLength') < mb_strlen($newValue)) { throw new UserInputException($option->optionName, 'tooLong'); } + + // search for censored words + if (ENABLE_CENSORSHIP) { + $result = Censorship::getInstance()->test($newValue); + if ($result) { + WCF::getTPL()->assign('censoredWords', $result); + throw new UserInputException($option->optionName, 'censoredWordsFound'); + } + } } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index a5b346d42f..e6768be1b2 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2624,6 +2624,7 @@ Fehler sind beispielsweise: + 1} ({#$number}×){/if}{/implode}]]> user->banExpires != 0} bis zum {@$__wcf->user->banExpires|plainTime}{/if} gesperrt{if $__wcf->user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index a5a385bd4b..f32429558d 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2515,6 +2515,7 @@ Errors are: + 1} ({#$number}×){/if}{/implode}]]> user->banExpires != 0} until {@$__wcf->user->banExpires|plainTime}{/if}{if $__wcf->user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]>