/** * @see \wcf\page\IPage::readParameters() */ public function readParameters() { parent::readParameters(); // letters if (isset($_REQUEST['letter']) && mb_strlen($_REQUEST['letter']) == 1 && mb_strpos(self::$availableLetters, $_REQUEST['letter']) !== false) { $this->letter = $_REQUEST['letter']; } // news by category if (isset($_REQUEST['id'])) { // get category id $this->categoryID = intval($_REQUEST['id']); // get category by id $this->category = CategoryHandler::getInstance()->getCategory($this->categoryID); // check category if ($this->category === null) { throw new IllegalLinkException(); } $this->category = new NewsCategory($this->category); if (!$this->category->isAccessible()) { throw new PermissionDeniedException(); } } else { if (isset($_REQUEST['userID'])) { $this->userID = intval($_REQUEST['userID']); $this->user = new User($this->userID); if (!$this->user->userID) { throw new IllegalLinkException(); } } } }
/** * @see \wcf\page\IPage::readParameters() */ public function readParameters() { parent::readParameters(); // categorized entries if (isset($_REQUEST['id'])) { $this->categoryID = intval($_REQUEST['id']); $this->category = CategoryHandler::getInstance()->getCategory($this->categoryID); if ($this->category === null) { throw new IllegalLinkException(); } $this->category = new FilebaseCategory($this->category); if (!$this->category->isAccessible()) { throw new PermissionDeniedException(); } } else { if (isset($_REQUEST['userID'])) { $this->userID = intval($_REQUEST['userID']); $this->user = new User($this->userID); if (!$this->user->userID) { throw new IllegalLinkException(); } } } }