aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter/s9e/utils.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/textformatter/s9e/utils.php')
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php5
1 files changed, 4 insertions, 1 deletions
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;
}