diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2004-07-27 19:47:27 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-07-27 19:47:27 +0000 |
| commit | 895f262eb5c7355203f84898154b47a6064f6221 (patch) | |
| tree | ed3e02f5e8f724cb122fb87ed2a405081ee77a24 | |
| parent | bfec4fb8fca43dc46302d44fcfa8c6c4377d4750 (diff) | |
| download | forums-895f262eb5c7355203f84898154b47a6064f6221.tar forums-895f262eb5c7355203f84898154b47a6064f6221.tar.gz forums-895f262eb5c7355203f84898154b47a6064f6221.tar.bz2 forums-895f262eb5c7355203f84898154b47a6064f6221.tar.xz forums-895f262eb5c7355203f84898154b47a6064f6221.zip | |
do not update post_text if the message content was not changed... (fixing a bug ;))
git-svn-id: file:///svn/phpbb/trunk@4938 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/posting.php | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 8368584767..b08263a5a9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -561,13 +561,19 @@ if ($submit || $preview || $refresh) // Grab md5 'checksum' of new message $message_md5 = md5($message_parser->message); + $update_message = ($mode != 'edit' || $message_md5 != $post_checksum || $status_switch || $preview) ? true : false; // Check checksum ... don't re-parse message if the same - if ($mode != 'edit' || $message_md5 != $post_checksum || $status_switch || $preview) + + // Parse message + if ($update_message) { - // Parse message $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, $quote_status); } + else + { + $message_parser->bbcode_bitfield = $bbcode_bitfield; + } if ($mode != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('f_ignoreflood', $forum_id)) { @@ -767,7 +773,7 @@ if ($submit || $preview || $refresh) 'bbcode_bitfield' => (int) $message_parser->bbcode_bitfield ); - 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); + 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, $update_message); } } @@ -1191,7 +1197,7 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $data) // Submit Post -function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_uid, $poll, $attach_data, $filename_data, $data) +function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_uid, $poll, $attach_data, $filename_data, $data, $update_message = true) { global $db, $auth, $user, $config, $phpEx, $SID, $template, $phpbb_root_path; @@ -1206,10 +1212,12 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ if ($mode == 'post') { $post_mode = 'post'; + $update_message = true; } else if ($mode != 'edit') { $post_mode = 'reply'; + $update_message = true; } else if ($mode == 'edit') { @@ -1290,7 +1298,6 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ 'enable_sig' => $data['enable_sig'], 'post_username' => ($username && $data['poster_id'] == ANONYMOUS) ? stripslashes($username) : '', 'post_subject' => $subject, - 'post_text' => $message, 'post_edit_reason' => $data['post_edit_reason'], 'post_edit_user' => (int) $data['post_edit_user'], 'post_checksum' => $data['message_md5'], @@ -1300,7 +1307,13 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ 'bbcode_uid' => $bbcode_uid, 'post_edit_locked' => $data['post_edit_locked']) ); - break; + + if ($update_message) + { + $sql_data[POSTS_TABLE]['sql']['post_text'] = $message; + } + + break; } // And the topic ladies and gentlemen |
