1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 12:33:29 +01:00

[ticket/13847] Updated ucp_pm_compose to use the utils service

...when quoting a post

PHPBB3-13847
This commit is contained in:
JoshyPHP 2015-05-25 20:54:30 +02:00
parent e50d9186ce
commit 2a7a06da2a
2 changed files with 19 additions and 1 deletions

View File

@ -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)

View File

@ -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());
}
}