From 63f5cff824ed9c210f0adb933c3dd8a8bcfc17be Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 26 Jul 2009 16:16:30 +0000 Subject: [PATCH] Preserve post options when refusing to save the post as a draft. #39115 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9859 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/posting.php | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index b0a2937dcf..d72e75b009 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -177,6 +177,7 @@
  • [Fix] Correctly set attachment flag for topics, posts and pms after deleting attachments (Bug #48265 - Patch by WorldWar and nickvergessen)
  • [Fix] Display "Locked" button instead of "Reply" one for locked forum in viewtopic (prosilver). (Bug #38055 - Patch by Raimon)
  • [Fix] Correctly propagate umlauts over search result pages (Bug #33755)
  • +
  • [Fix] Preserve post options when refusing to save the post as a draft. (Bug #39115)
  • [Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
  • [Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)
  • [Change] Template engine now permits to a limited extent variable includes.
  • diff --git a/phpBB/posting.php b/phpBB/posting.php index d304168153..919d92b27c 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -545,6 +545,47 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( ) ); + $hidden_fields = array( + 'icon_id' => 0, + + 'disable_bbcode' => false, + 'disable_smilies' => false, + 'disable_magic_url' => false, + 'attach_sig' => true, + 'lock_topic' => false, + + 'topic_type' => POST_NORMAL, + 'topic_time_limit' => 0, + + 'poll_title' => '', + 'poll_option_text' => '', + 'poll_max_options' => 1, + 'poll_length' => 0, + 'poll_vote_change' => false, + ); + + foreach ($hidden_fields as $name => $default) + { + if (!isset($_POST[$name])) + { + // Don't include it, if its not available + unset($hidden_fields[$name]); + continue; + } + + if (is_bool($default)) + { + // Use the string representation + $hidden_fields[$name] = request_var($name, ''); + } + else + { + $hidden_fields[$name] = request_var($name, $default); + } + } + + $s_hidden_fields .= build_hidden_fields($hidden_fields); + confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); } }