/**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     // validate the news category ids
     if (empty($this->categoryIDs)) {
         throw new UserInputException('categoryIDs', 'empty');
     }
     foreach ($this->categoryIDs as $categoryID) {
         $category = CategoryHandler::getInstance()->getCategory($categoryID);
         if ($category === null) {
             throw new UserInputException('categoryIDs');
         }
         // get category
         $category = new NewsCategory($category);
         // check, if the current user can use this category
         if (!$category->canUseCategory()) {
             throw new UserInputException('categoryIDs');
         }
     }
     // validate publication date
     if ($this->enableDelayedPublication) {
         $publicationDateTimestamp = @strtotime($this->publicationDate);
         if ($publicationDateTimestamp === false || $publicationDateTimestamp > 2147483647) {
             throw new UserInputException('publicationDate', 'invalid');
         }
     }
     // validate archiving date
     if ($this->enableAutomaticArchiving) {
         $archivingDateTimestamp = @strtotime($this->archivingDate);
         if ($archivingDateTimestamp === false || $archivingDateTimestamp <= TIME_NOW) {
             throw new UserInputException('archivingDate', 'invalid');
         }
         // date exceeds max integer
         if ($archivingDateTimestamp > 2147483647) {
             throw new UserInputException('archivingDate', 'invalid');
         }
         // archive news before publishing it at all
         if ($this->enableDelayedPublication && $publicationDateTimestamp >= $archivingDateTimestamp) {
             throw new UserInputException('archivingDate', 'beforePublication');
         }
     }
     // validate tags
     $this->validateTags();
     // validate source
     if (NEWS_ENTRY_ENABLE_SOURCES) {
         $this->validateSources();
     }
     // validate news picture
     if (NEWS_ENABLE_NEWSPICTURE) {
         if (NEWS_ENABLE_NEWSPICTURE_REQUIRED && !$this->pictureID) {
             throw new UserInputException('pictureID', 'empty');
         }
         if ($this->pictureID && !$this->picture->pictureID) {
             throw new UserInputException('pictureID', 'notValid');
         }
     }
     // validate poll
     if ($this->canCreatePoll()) {
         PollManager::getInstance()->validate();
     }
 }