aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php6
-rw-r--r--tests/functional/private_messages_test.php14
2 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 59952182df..67e53718a0 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -947,7 +947,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{
$message_link = '';
}
- $message_parser->message = $message_link . '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
+ $quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote(
+ censor_text(trim($message_parser->message)),
+ array('author' => $quote_username)
+ );
+ $message_parser->message = $message_link . $quote_text . "\n";
}
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php
index 1f6dc3a979..4851fc4c64 100644
--- a/tests/functional/private_messages_test.php
+++ b/tests/functional/private_messages_test.php
@@ -66,4 +66,18 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
$crawler = self::submit($form);
$this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
}
+
+ public function test_quote()
+ {
+ $text = 'Test post';
+ $expected = '[quote="admin"]' . $text . '[/quote]';
+
+ $this->login();
+ $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic');
+ $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text);
+
+ $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=quotepost&p=' . $post['post_id'] . '&sid=' . $this->sid);
+
+ $this->assertContains($expected, $crawler->filter('textarea#message')->text());
+ }
}