/**
  * @see Form::validate()
  */
 public function validate()
 {
     if (empty($_POST['fDo']) || $_POST['fDo'] != 'mod' || !empty($_POST['deleteTemplate'])) {
         return;
     }
     if (empty($this->subject)) {
         throw new UserInputException('subject', 'empty');
     }
     if (empty($this->text)) {
         throw new UserInputException('text', 'empty');
     }
     if (UserWantedPosterData::templateExists($this->tplID, $this->subject)) {
         throw new UserInputException('subject', 'exists');
     }
     parent::validate();
 }
 /**
  * @see Form::validate()
  */
 public function validate()
 {
     if (!count($this->groupIDs)) {
         throw new UserInputException('groupIDs', 'empty');
     }
     if (!@is_int($this->maxLifeTime)) {
         throw new UserInputException('maxLifeTime', 'isNoInteger');
     }
     if (empty($this->subject)) {
         throw new UserInputException('subject', 'empty');
     }
     if (empty($this->text)) {
         throw new UserInputException('text', 'empty');
     } else {
         if (StringUtil::length($this->text) > $this->maxTextLength) {
             throw new UserInputException('text', 'tooLong');
         } else {
             if (defined('ENABLE_CENSORSHIP') && ENABLE_CENSORSHIP) {
                 require_once WCF_DIR . 'lib/data/message/censorship/Censorship.class.php';
                 $result = Censorship::test($this->text);
                 if ($result) {
                     WCF::getTPL()->assign('censoredWords', $result);
                     throw new UserInputException('text', 'censoredWordsFound');
                 }
             }
         }
     }
     parent::validate();
 }
 /**
  * @see Form::validate()
  */
 public function validate()
 {
     parent::validate();
     $this->validateDate();
 }