mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
16 lines
389 B
PHP
16 lines
389 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
$post = (new Manager\ForumPost())->findById((int)($_GET['postid'] ?? 0));
|
|
if (is_null($post)) {
|
|
json_die("failure", "empty postid");
|
|
} elseif (!$Viewer->readAccess($post->thread()->forum())) {
|
|
json_die("failure", "assholes");
|
|
}
|
|
|
|
json_print("success", ["body" => nl2br($post->body())]);
|