/** * Validates the given prefix. */ protected function validatePrefix() { if ($this->board->prefixRequired && empty($this->prefix)) { throw new UserInputException('prefix'); } $prefixes = $this->board->getPrefixOptions(); if (!empty($this->prefix) && !isset($prefixes[$this->prefix])) { throw new UserInputException('prefix', 'invalid'); } }
/** * Changes the prefix of the selected thread. */ public function changePrefix() { if (!$this->board->getModeratorPermission('canEditPost')) { return; } $prefixOptions = $this->board->getPrefixOptions(); if (empty($this->prefix) && !$this->board->prefixRequired || isset($prefixOptions[$this->prefix])) { $this->thread->setPrefix($this->prefix); if ($this->thread->lastPostTime == $this->board->getLastPostTime()) { WCF::getCache()->clearResource('boardData', true); } } }