', $string);
}
function utf8tohtml($utf8) {
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index d533460e..3ff6a9b1 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1222,7 +1222,7 @@ function mod_ban_post($board, $delete, $post, $token = false) {
$_POST['message'] = str_replace('%LENGTH%', strtoupper($length_english), $_POST['message']);
$query = prepare(sprintf('UPDATE `posts_%s` SET `body_nomarkup` = CONCAT(`body_nomarkup`, :body_nomarkup) WHERE `id` = :id', $board));
$query->bindValue(':id', $post);
- $query->bindValue(':body_nomarkup', sprintf("\n%s", $_POST['message']));
+ $query->bindValue(':body_nomarkup', sprintf("\n%s", utf8tohtml($_POST['message'])));
$query->execute() or error(db_error($query));
rebuildPost($post);
@@ -1302,10 +1302,13 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $postID) . '#' . $postID, true, $config['redirect_http']);
} else {
if ($config['minify_html']) {
- $post['body_nomarkup'] = str_replace("\n", '
', $post['body_nomarkup']);
- $post['body'] = str_replace("\n", '
', $post['body']);
+ // $post['body_nomarkup'] = str_replace("\n", '
', $post['body_nomarkup']);
+ // $post['body'] = str_replace("\n", '
', $post['body']);
}
+ // Minifying this page causes an issue with newlines in the textarea. This is a temporary solution.
+ $config['minify_html'] = false;
+
mod_page(_('Edit post'), 'mod/edit_post_form.html', array('token' => $security_token, 'board' => $board, 'raw' => $edit_raw_html, 'post' => $post));
}
}
diff --git a/templates/mod/edit_post_form.html b/templates/mod/edit_post_form.html
index 146e725b..b9359c68 100644
--- a/templates/mod/edit_post_form.html
+++ b/templates/mod/edit_post_form.html
@@ -32,7 +32,7 @@
{% trans %}Comment{% endtrans %}
-
+
|