aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-03-19 15:21:17 -0700
committerCesar G <prototech91@gmail.com>2015-03-19 15:32:31 -0700
commit1df97c205dcb0bd19cee5743b21a4647d247a85a (patch)
tree695dd93f7ea7c4e93f1d9982fd5c04eac0017bbf
parent62973faf4b4834715b510cee65796048820ff6eb (diff)
downloadforums-1df97c205dcb0bd19cee5743b21a4647d247a85a.tar
forums-1df97c205dcb0bd19cee5743b21a4647d247a85a.tar.gz
forums-1df97c205dcb0bd19cee5743b21a4647d247a85a.tar.bz2
forums-1df97c205dcb0bd19cee5743b21a4647d247a85a.tar.xz
forums-1df97c205dcb0bd19cee5743b21a4647d247a85a.zip
[ticket/13555] Render poll options separately when previewing.
This prevents an option from being split into two when a line break is present inside of it. PHPBB3-13555
-rw-r--r--phpBB/posting.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 61df10b125..964b0f1f8b 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1222,9 +1222,13 @@ if (!sizeof($error) && $preview)
'L_MAX_VOTES' => ($post_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $post_data['poll_max_options']))
);
- $parse_poll->message = implode("\n", $post_data['poll_options']);
- $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']);
- $preview_poll_options = explode('<br />', $parse_poll->message);
+ $preview_poll_options = array();
+ foreach ($post_data['poll_options'] as $poll_option)
+ {
+ $parse_poll->message = $poll_option;
+ $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']);
+ $preview_poll_options[] = $parse_poll->message;
+ }
unset($parse_poll);
foreach ($preview_poll_options as $key => $option)