X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/05c560470887c86a30c82360d7be5caf0de1baa4..ed1cd294e32647b117688b25a465889e4664fe03:/issue/index.php diff --git a/issue/index.php b/issue/index.php index a4b1314..9a35df8 100644 --- a/issue/index.php +++ b/issue/index.php @@ -59,14 +59,11 @@ if ($_POST and isset($_POST['subject'])) { if (!$row->id) { throw new Exception('Issue niet goed opgeslagen.'); } - $query = $Db->set('comments', [ - 'page' => "{$Page->handler}/{$row->id}", - 'raw' => $_POST['body'], - 'message' => messagehtml($_POST['body']), - 'author' => $User->login, - ]); - if (!$query->rowCount()) { - throw new Exception('Issueinhoud niet opgeslagen.'); + try { + createcomment($_POST, $row); + } + catch (Exception $e) { + throw new Exception("Issueinhoud niet opgeslagen: {$e->getMessage()}."); } $_POST = []; }