wikiService = $wikiService; } /** * Get the activity feed for an article. The service's getArticleActivity() is the precise * per-article-project IDOR fence; this VIEW gate stops non-viewers at dispatch. */ #[RequiresPermission(WikiPermissions::VIEW, entityScoped: true)] public function get(): void { $articleId = (int) $this->incomingRequest->query->get('articleId', 0); if ($articleId <= 0) { $this->tpl->assign('activity', []); $this->tpl->assign('articleId', 0); return; } // Get the article for created/modified fallback $article = $this->wikiService->getArticle($articleId); $activity = $this->wikiService->getArticleActivity($articleId, 20); // Always append the article's created date as the final entry if ($article && ! empty($article->created)) { $activity[] = [ 'type' => 'baseline', 'action' => 'article.create', 'date' => $article->created, 'firstname' => $article->firstname ?? '', 'lastname' => $article->lastname ?? '', 'profileId' => $article->profileId ?? '', 'values' => [], ]; } $this->tpl->assign('activity', $activity); $this->tpl->assign('articleId', $articleId); } }