upload: common function to parse user text input
[minimedit.git] / issue / index.php
index bb556f2019d6e259d70ca8a943cdc40757b75c50..82fa39e024287b442086c82dd824e8010a24d8b5 100644 (file)
@@ -37,12 +37,11 @@ if ($id and ctype_digit($id)) {
 }
 
 if ($_POST) {
-               $html = nl2br(htmlspecialchars($_POST['body']));
-               $html = empty($html) ? NULL : "<p>$html</p>";
+               require_once 'upload.inc.php';
                $query = $Db->set('issues', [
                        'page'    => $Page,
                        'subject' => $_POST['subject'],
-                       'body'    => $html,
+                       'body'    => messagehtml($_POST['body']),
                        'author'  => $User->login,
                ]);
                if (!$query->rowCount()) {