aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php2
-rw-r--r--tests/text_formatter/s9e/utils_test.php5
2 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php
index 64fdb628ca..803c71a5a2 100644
--- a/phpBB/phpbb/textformatter/s9e/utils.php
+++ b/phpBB/phpbb/textformatter/s9e/utils.php
@@ -69,7 +69,7 @@ class utils implements \phpbb\textformatter\utils_interface
$quote .= ' ' . $name . '=' . $this->enquote($value);
}
$quote .= ']';
- $newline = (strlen($quote . $text . '[/quote]') > 80) ? "\n" : '';
+ $newline = (strlen($quote . $text . '[/quote]') > 80 || strpos($text, "\n") !== false) ? "\n" : '';
$quote .= $newline . $text . $newline . '[/quote]';
return $quote;
diff --git a/tests/text_formatter/s9e/utils_test.php b/tests/text_formatter/s9e/utils_test.php
index d40d450f5a..152c316b2e 100644
--- a/tests/text_formatter/s9e/utils_test.php
+++ b/tests/text_formatter/s9e/utils_test.php
@@ -181,6 +181,11 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
array(),
'[quote]This is a short quote on its own line[/quote]',
),
+ array(
+ "This is a short quote\non two lines",
+ array(),
+ "[quote]\nThis is a short quote\non two lines\n[/quote]",
+ ),
);
}