From f31b4142203fe781b759bdb46d8c14bff9f0896e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 7 Jun 2003 16:37:16 +0000 Subject: [PATCH] fixed: message post storage. We do not hold the parsed message, only the decoded one for displaying within the textarea. git-svn-id: file:///svn/phpbb/trunk@4094 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 14 +++++++------- phpBB/posting.php | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 533cc1fd9e..d7cedcf438 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -154,7 +154,7 @@ function format_display($message, $html, $bbcode, $uid, $url, $smilies, $sig) $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $message . '<'), 1, -1)); } - $message = nl2br($message); + $message = str_replace("\n", '
', $message); // Signature $user_sig = ($sig && $config['allow_sig']) ? trim($user->data['user_sig']) : ''; @@ -166,22 +166,22 @@ function format_display($message, $html, $bbcode, $uid, $url, $smilies, $sig) $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); } - $user_sig = (empty($user->data['user_allowsmile']) || empty($config['enable_smilies'])) ? preg_replace('##', '\1', $user_sig) : str_replace('(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $user_sig . '<'), 1, -1)); } - $user_sig = '
_________________
' . nl2br($user_sig); + $user_sig = '
_________________
' . str_replace("\n", '
', $user_sig); } else { $user_sig = ''; } - $message = (empty($smilies) || empty($config['allow_smilies'])) ? preg_replace('##', '\1', $message) : str_replace(' $post_data['enable_urls'], 'bbcode_uid' => $bbcode_uid, 'bbcode_bitfield' => $post_data['bbcode_bitfield'], - 'post_edit_locked' => $post_data['post_edit_locked'] + 'post_edit_locked' => $post_data['post_edit_locked'], + 'post_text' => $message ); if ($mode != 'edit') @@ -971,7 +972,6 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ { $post_sql = array_merge($post_sql, array( 'post_checksum' => $post_data['message_md5'], - 'post_text' => $message, 'post_encoding' => $user->lang['ENCODING']) ); } diff --git a/phpBB/posting.php b/phpBB/posting.php index 15fb1250bb..7dab9077c6 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -646,7 +646,7 @@ if ($submit || $preview || $refresh) $message_md5 = md5($message_parser->message); // Check checksum ... don't re-parse message if the same - if ($mode != 'edit' || $message_md5 != $post_checksum || $status_switch) + if ($mode != 'edit' || $message_md5 != $post_checksum || $status_switch || $preview) { // Parse message if ($result = $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status)) @@ -802,6 +802,7 @@ if ($submit || $preview || $refresh) 'bbcode_bitfield' => $message_parser->bbcode_bitfield ); + echo ";
".$message_parser->message."
"; submit_post($mode, $message_parser->message, $subject, $username, $topic_type, $message_parser->bbcode_uid, $poll, $message_parser->attachment_data, $message_parser->filename_data, $post_data); }