mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-08-03 07:15:53 -04:00
20 lines
421 B
PHP
20 lines
421 B
PHP
<?php
|
|
|
|
if (!$Viewer->permitted('site_moderate_forums')) {
|
|
error(403);
|
|
}
|
|
authorize();
|
|
|
|
$thread = (new Gazelle\Manager\ForumThread())->findById((int)($_POST['threadid'] ?? 0));
|
|
if (is_null($thread)) {
|
|
error(404);
|
|
}
|
|
$body = trim($_POST['body'] ?? '');
|
|
if (!strlen($body)) {
|
|
error("Thread note cannot be empty");
|
|
}
|
|
|
|
$thread->addThreadNote($Viewer, $body);
|
|
|
|
header("Location: {$thread->location()}#thread_notes");
|