Mh, füg bitte mal folgenden Code in die news/lib/form/NewsAddForm.class.php ein
PHP: NewsAddForm.class.php
private function checkContent($name, $value, $minCharacter, $maxLength, $minWords, $censorship) {
if(is_array($value)) $value = "";
$this->htmlInputProcessor[$name] = new HtmlInputProcessor();
$this->htmlInputProcessor[$name]->process($value, $this->messageObjectType, 0);
$message = $this->htmlInputProcessor[$name]->getTextContent();
$length = mb_strlen($message);
// check character length
if ($minCharacter > 0 && $length < $minCharacter) {
WCF::getTPL()->assign('minCharLength', $minCharacter);
throw new UserInputException($name, 'minCharLength');
}
if ($minWords > 0 && count(explode(' ', $message)) < $minWords) {
WCF::getTPL()->assign('minWords', $minWords);
throw new UserInputException($name, 'minWordCount');
}
// check object max length
if ($maxLength != 0 && $length > $maxLength) {
WCF::getTPL()->assign('maxLength', $maxLength);
throw new UserInputException($name, 'tooLong');
}
if (ENABLE_CENSORSHIP && $censorship == true) {
$result = Censorship::getInstance()->test($message);
if ($result) {
WCF::getTPL()->assign("censoredWords" . $name, $result);
throw new UserInputException($name, 'censoredWordsFound');
}
}
if (WCF::getLanguage()->get($message, true) != $message && WCF::getLanguage()->get($message, true) != '') {
throw new UserInputException($name, 'langvar');
}
$disallowedBBCodes = $this->htmlInputProcessor[$name]->validate();
if (!empty($disallowedBBCodes)) {
WCF::getTPL()->assign('disallowedBBCodes', $disallowedBBCodes);
throw new UserInputException($name, 'disallowedBBCodes');
}
return $this->htmlInputProcessor[$name]->getHtml();
}
Alles anzeigen