session = $session; } protected function rawContent(array $request = []) { if (!$this->session->isAuthenticated()) { throw new HttpException\ForbiddenException($this->l10n->t('Access denied.')); } if (empty($this->parameters['id'])) { throw new HTTPException\BadRequestException(); } $item = Post::selectFirstForUser($this->session->getLocalUserId(), ['uri-id'], ['uid' => [0, $this->session->getLocalUserId()], 'uri-id' => $this->parameters['id']]); if (empty($item)) { throw new HTTPException\NotFoundException(); } $search = DBA::selectFirst('post-searchindex', [], ['uri-id' => $item['uri-id']]); if (empty($search)) { throw new HTTPException\NotFoundException(); } $this->httpExit(Post\Engagement::unescapeKeywords($search['searchtext'])); } }