upload: common function to parse user text input
[minimedit.git] / issue / index.php
index 388db5d836acce3019b375e8b04e636ffd5a9e08..82fa39e024287b442086c82dd824e8010a24d8b5 100644 (file)
@@ -16,7 +16,7 @@ if ($id and ctype_digit($id)) {
        $author = $Issue->author ? new User('profile/'.$Issue->author, FALSE) : NULL;
        printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
                'Geplaatst',
-               $author ? " door <strong>{$author->name}</strong>" : '',
+               $author ? " door <strong>{$author->html}</strong>" : '',
                showdate(preg_split('/\D/', $Issue->created))
        );
        if ($Issue->assign) {
@@ -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()) {