namespace wcf\system\option;
use wcf\data\option\Option;
use wcf\system\exception\UserInputException;
+use wcf\system\message\censorship\Censorship;
use wcf\system\WCF;
/**
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');
+ }
+ }
}
}
<item name="wcf.user.option.error.tooShort"><![CDATA[Der eingegebene Text ist zu kurz.]]></item>
<item name="wcf.user.option.error.validationFailed"><![CDATA[Sie haben einen ungültigen Inhalt eingegeben.]]></item>
<item name="wcf.user.option.error.birthdayTooYoung"><![CDATA[Sie sind zu jung. Für eine Anmeldung auf dieser Seite müssen Sie mindestens {#REGISTER_MIN_USER_AGE} Jahre alt sein.]]></item>
+ <item name="wcf.user.option.error.censoredWordsFound"><![CDATA[Ihr Text enthält folgende zensierte Wörter: {implode from=$censoredWords key=censoredWord item=number}{$censoredWord}{if $number > 1} ({#$number}×){/if}{/implode}]]></item>
<item name="wcf.user.error.isBanned"><![CDATA[Ihr Benutzeraccount wurde{if $__wcf->user->banExpires != 0} bis zum {@$__wcf->user->banExpires|plainTime}{/if} gesperrt{if $__wcf->user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]></item>
<item name="wcf.user.access.everyone"><![CDATA[Jeder]]></item>
<item name="wcf.user.access.following"><![CDATA[Benutzer, denen ich folge]]></item>
<item name="wcf.user.option.error.tooShort"><![CDATA[Entered text is too short.]]></item>
<item name="wcf.user.option.error.validationFailed"><![CDATA[Entered text is invalid.]]></item>
<item name="wcf.user.option.error.birthdayTooYoung"><![CDATA[You’re not old enough. To register with this website you must be at least {#REGISTER_MIN_USER_AGE} years old.]]></item>
+ <item name="wcf.user.option.error.censoredWordsFound"><![CDATA[Text contains censored words: {implode from=$censoredWords key=censoredWord item=number}{$censoredWord}{if $number > 1} ({#$number}×){/if}{/implode}]]></item>
<item name="wcf.user.error.isBanned"><![CDATA[Your user account has been banned{if $__wcf->user->banExpires != 0} until {@$__wcf->user->banExpires|plainTime}{/if}{if $__wcf->user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]></item>
<item name="wcf.user.access.everyone"><![CDATA[Everyone]]></item>
<item name="wcf.user.access.following"><![CDATA[Users I’m following]]></item>