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 utils when forwarding
PHPBB3-13847
This commit is contained in:
parent
2a7a06da2a
commit
64e1824abd
@ -979,7 +979,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
|
||||
$forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
|
||||
|
||||
$message_parser->message = implode("\n", $forward_text) . "\n\n[quote="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
|
||||
$quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote(
|
||||
censor_text(trim($message_parser->message)),
|
||||
array('author' => $quote_username)
|
||||
);
|
||||
$message_parser->message = implode("\n", $forward_text) . "\n\n" . $quote_text;
|
||||
$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
||||
$this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
|
||||
}
|
||||
|
||||
public function test_quote()
|
||||
public function test_quote_post()
|
||||
{
|
||||
$text = 'Test post';
|
||||
$expected = '[quote="admin"]' . $text . '[/quote]';
|
||||
@ -80,4 +80,17 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
||||
|
||||
$this->assertContains($expected, $crawler->filter('textarea#message')->text());
|
||||
}
|
||||
|
||||
public function test_quote_forward()
|
||||
{
|
||||
$text = 'This is a test private message sent by the testing framework.';
|
||||
$expected = '[quote="admin"]' . $text . '[/quote]';
|
||||
|
||||
$this->login();
|
||||
$message_id = $this->create_private_message('Test', $text, array(2));
|
||||
|
||||
$crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=forward&f=0&p=' . $message_id . '&sid=' . $this->sid);
|
||||
|
||||
$this->assertContains($expected, $crawler->filter('textarea#message')->text());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user