diff options
| author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-06-24 16:34:53 +0200 |
|---|---|---|
| committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-06-24 16:34:53 +0200 |
| commit | d430acb5680ddfd249daf1bd41a268ed47a6823e (patch) | |
| tree | fa9d056d31b7237843842f982a2aaf300f4d1cd7 /phpBB | |
| parent | c1b16930989774051fbc84c8e5634dd83aae7835 (diff) | |
| parent | 433021f429f22dfd6d5dfc16c11195b19a488161 (diff) | |
| download | forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar.gz forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar.bz2 forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar.xz forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.zip | |
Merge pull request #3669 from s9e/ticket/13901
[ticket/13901] Add more whitespace to long quotes for readability
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/textformatter/s9e/utils.php | 5 | ||||
| -rw-r--r-- | phpBB/posting.php | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 61dab982df..0989539a0f 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -942,10 +942,10 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $message_link = ''; } $quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote( - censor_text(trim($message_parser->message)), + censor_text($message_parser->message), array('author' => $quote_username) ); - $message_parser->message = $message_link . $quote_text . "\n"; + $message_parser->message = $message_link . $quote_text . "\n\n"; } if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) @@ -974,7 +974,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to'])); $quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote( - censor_text(trim($message_parser->message)), + censor_text($message_parser->message), array('author' => $quote_username) ); $message_parser->message = implode("\n", $forward_text) . "\n\n" . $quote_text; diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php index 04df589930..803c71a5a2 100644 --- a/phpBB/phpbb/textformatter/s9e/utils.php +++ b/phpBB/phpbb/textformatter/s9e/utils.php @@ -56,6 +56,7 @@ class utils implements \phpbb\textformatter\utils_interface */ public function generate_quote($text, array $attributes = array()) { + $text = trim($text); $quote = '[quote'; if (isset($attributes['author'])) { @@ -67,7 +68,9 @@ class utils implements \phpbb\textformatter\utils_interface { $quote .= ' ' . $name . '=' . $this->enquote($value); } - $quote .= ']' . $text . '[/quote]'; + $quote .= ']'; + $newline = (strlen($quote . $text . '[/quote]') > 80 || strpos($text, "\n") !== false) ? "\n" : ''; + $quote .= $newline . $text . $newline . '[/quote]'; return $quote; } diff --git a/phpBB/posting.php b/phpBB/posting.php index 48c7c36690..2f9beefcf9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1604,10 +1604,10 @@ if ($generate_quote) if ($config['allow_bbcode']) { $message_parser->message = $phpbb_container->get('text_formatter.utils')->generate_quote( - censor_text(trim($message_parser->message)), + censor_text($message_parser->message), array('author' => $post_data['quote_username']) ); - $message_parser->message .= "\n"; + $message_parser->message .= "\n\n"; } else { |
