From: Joas S. <nic...@ph...> - 2009-07-30 13:50:23
|
Author: nickvergessen Date: Thu Jul 30 14:39:38 2009 New Revision: 9892 Log: Fix Bug #47295 - Min/max characters per posts also affects polls option Authorised by: AcydBurn Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/message_parser.php Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Thu Jul 30 14:39:38 2009 *************** *** 181,186 **** --- 181,187 ---- <li>[Fix] Do not send private message back to sender if sender is in the same group the private message was sent to.</li> <li>[Fix] Correctly add user to a group making it a default one. (Bug #48345 - Patch by rxu)</li> <li>[Fix] Add log entry when copying forum permissions.</li> + <li>[Fix] Min/max characters per posts also affects polls option (Bug #47295 - Patch by nickvergessen)</li> <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> <li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li> <li>[Change] Template engine now permits to a limited extent variable includes.</li> Modified: branches/phpBB-3_0_0/phpBB/includes/message_parser.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/message_parser.php (original) --- branches/phpBB-3_0_0/phpBB/includes/message_parser.php Thu Jul 30 14:39:38 2009 *************** *** 1062,1071 **** { global $config, $db, $user; - $mode = ($mode != 'post') ? 'sig' : 'post'; - $this->mode = $mode; $this->allow_img_bbcode = $allow_img_bbcode; $this->allow_flash_bbcode = $allow_flash_bbcode; $this->allow_quote_bbcode = $allow_quote_bbcode; --- 1062,1082 ---- { global $config, $db, $user; $this->mode = $mode; + if (!isset($config['max_' . $mode . '_chars'])) + { + $config['max_' . $mode . '_chars'] = 0; + } + if (!isset($config['max_' . $mode . '_smilies'])) + { + $config['max_' . $mode . '_smilies'] = 0; + } + if (!isset($config['max_' . $mode . '_urls'])) + { + $config['max_' . $mode . '_urls'] = 0; + } + $this->allow_img_bbcode = $allow_img_bbcode; $this->allow_flash_bbcode = $allow_flash_bbcode; $this->allow_quote_bbcode = $allow_quote_bbcode; *************** *** 1100,1106 **** } // Minimum message length check for post only ! if ($mode !== 'sig') { if (!$message_length || $message_length < (int) $config['min_post_chars']) { --- 1111,1117 ---- } // Minimum message length check for post only ! if ($mode === 'post') { if (!$message_length || $message_length < (int) $config['min_post_chars']) { *************** *** 1153,1159 **** // Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length. // The maximum length check happened before any parsings. ! if ($mode !== 'sig' && utf8_clean_string($this->message) === '') { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return (!$update_this_message) ? $return_message : $this->warn_msg; --- 1164,1170 ---- // Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length. // The maximum length check happened before any parsings. ! if ($mode === 'post' && utf8_clean_string($this->message) === '') { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return (!$update_this_message) ? $return_message : $this->warn_msg; *************** *** 1629,1635 **** $this->message = $poll['poll_option_text']; $bbcode_bitfield = $this->bbcode_bitfield; ! $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false); $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); $this->message = $tmp_message; --- 1640,1646 ---- $this->message = $poll['poll_option_text']; $bbcode_bitfield = $this->bbcode_bitfield; ! $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll'); $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); $this->message = $tmp_message; *************** *** 1652,1658 **** { $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; } ! $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false); if (strlen($poll['poll_title']) > 255) { $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG']; --- 1663,1669 ---- { $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; } ! $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll'); if (strlen($poll['poll_title']) > 255) { $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG']; |