private function sanitize() { if (false === ($this->thread = GWF_ForumThread::getByID(Common::getGetString('tid')))) { return $this->module->error('err_thread'); } $this->ppt = $this->module->getPostsPerThread(); $this->nPosts = $this->thread->getPostCount(); $this->nPages = GWF_PageMenu::getPagecount($this->ppt, $this->nPosts); $default_page = isset($_GET['last_page']) ? $this->nPages : 1; $this->page = Common::clamp(Common::getGetInt('page'), $default_page, $this->nPages); if (!$this->thread->getBoard()) { return $this->module->error('err_thread_perm'); } if (!$this->thread->hasPermission(GWF_Session::getUser())) { return $this->module->error('err_thread_perm'); } if ($this->thread->isInModeration()) { return $this->module->error('err_in_mod'); } return false; }