From ab364525433a7194d050e4ec13ae08d603fdad43 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 31 Jul 2013 19:50:25 -0400 Subject: [PATCH] fix post editing for tinyboard markup --- inc/mod/pages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2808dc56..3ff6a9b1 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1276,7 +1276,7 @@ function mod_edit_post($board, $edit_raw_html, $postID) { if (isset($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['body'])) { if ($edit_raw_html) - $query = prepare(sprintf('UPDATE `posts_%s` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body WHERE `id` = :id', $board)); + $query = prepare(sprintf('UPDATE `posts_%s` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup WHERE `id` = :id', $board)); else $query = prepare(sprintf('UPDATE `posts_%s` SET `name` = :name, `email` = :email, `subject` = :subject, `body_nomarkup` = :body WHERE `id` = :id', $board)); $query->bindValue(':id', $postID); @@ -1284,6 +1284,10 @@ function mod_edit_post($board, $edit_raw_html, $postID) { $query->bindValue(':email', $_POST['email']); $query->bindValue(':subject', $_POST['subject']); $query->bindValue(':body', $_POST['body']); + if ($edit_raw_html) { + $body_nomarkup = '' . $_POST['body'] . ''; + $query->bindValue(':body_nomarkup', $body_nomarkup); + } $query->execute() or error(db_error($query)); if ($edit_raw_html) {