1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge pull request #4357 from rxu/ticket/14660

[ticket/14660] Fix parsing board email messages through template engine.
This commit is contained in:
Marc Alexander
2016-06-19 22:33:29 +02:00
3 changed files with 157 additions and 13 deletions

View File

@@ -642,6 +642,9 @@ class acp_board
$messenger->template('test');
$messenger->set_addresses($user->data);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user->data['username']),
));
$messenger->send(NOTIFY_EMAIL);
trigger_error($user->lang('TEST_EMAIL_SENT') . adm_back_link($this->u_action));

View File

@@ -624,31 +624,34 @@ class messenger
*/
protected function setup_template()
{
global $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
global $phpbb_container;
if ($this->template instanceof \phpbb\template\template)
{
return;
}
$template_environment = new \phpbb\template\twig\environment(
$phpbb_container->get('config'),
$phpbb_container->get('filesystem'),
$phpbb_container->get('path_helper'),
$phpbb_container->getParameter('core.template.cache_path'),
$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_container->get('filesystem')
)
);
$template_environment->setLexer($phpbb_container->get('template.twig.lexer'));
$this->template = new \phpbb\template\twig\twig(
$phpbb_container->get('path_helper'),
$phpbb_container->get('config'),
new \phpbb\template\context(),
new \phpbb\template\twig\environment(
$phpbb_container->get('config'),
$phpbb_container->get('filesystem'),
$phpbb_container->get('path_helper'),
$phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_filesystem
)
),
$phpbb_container->getParameter('core.cache_dir'),
$template_environment,
$phpbb_container->getParameter('core.template.cache_path'),
$phpbb_container->get('user'),
$phpbb_container->get('template.twig.extensions.collection'),
$phpbb_extension_manager
$phpbb_container->get('ext.manager')
);
}