diff options
| author | JoshyPHP <s9e.dev@gmail.com> | 2015-05-30 22:17:14 +0200 |
|---|---|---|
| committer | JoshyPHP <s9e.dev@gmail.com> | 2015-05-30 22:17:14 +0200 |
| commit | 2f0d11ba3c28f27e535988de2a8d08f7b17aef92 (patch) | |
| tree | 6f420430011a90e64d73ff858182206469f3714c /phpBB | |
| parent | 073f3e6fdc5af190db85b6cdefd418af4312af9f (diff) | |
| download | forums-2f0d11ba3c28f27e535988de2a8d08f7b17aef92.tar forums-2f0d11ba3c28f27e535988de2a8d08f7b17aef92.tar.gz forums-2f0d11ba3c28f27e535988de2a8d08f7b17aef92.tar.bz2 forums-2f0d11ba3c28f27e535988de2a8d08f7b17aef92.tar.xz forums-2f0d11ba3c28f27e535988de2a8d08f7b17aef92.zip | |
[ticket/13901] Add more whitespace to long quotes for readability
PHPBB3-13901
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 4ff27e8cf1..ae0c0f6049 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..64fdb628ca 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) ? "\n" : ''; + $quote .= $newline . $text . $newline . '[/quote]'; return $quote; } diff --git a/phpBB/posting.php b/phpBB/posting.php index 1c7b756fc2..4f4c6cd373 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1598,10 +1598,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 { |
