summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-07-31 19:50:25 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-31 21:26:55 -0400
commitab364525433a7194d050e4ec13ae08d603fdad43 (patch)
treed42211b0057b69a4986fb3a42506fc77aec2a0c5
parentea2b8cce077a092e0cbf136f9a45158668cc5ecf (diff)
fix post editing for tinyboard markup
-rw-r--r--inc/mod/pages.php6
1 files changed, 5 insertions, 1 deletions
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 = '<tinyboard raw html>' . $_POST['body'] . '</tinyboard>';
+ $query->bindValue(':body_nomarkup', $body_nomarkup);
+ }
$query->execute() or error(db_error($query));
if ($edit_raw_html) {