Files
ops-Gazelle/sections/forums/topic_notes_handle.php
T
2023-11-20 21:09:16 +01:00

20 lines
425 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->id(), $body);
header("Location: {$thread->location()}#thread_notes");