diff --git a/phpBB/includes/template/twig/twig.php b/phpBB/includes/template/twig/twig.php index f5638972a3..92a37d1634 100644 --- a/phpBB/includes/template/twig/twig.php +++ b/phpBB/includes/template/twig/twig.php @@ -172,7 +172,7 @@ class phpbb_template_twig implements phpbb_template */ public function set_filenames(array $filename_array) { - $this->filenames = array_merge($filename_array, $this->filenames); + $this->filenames = array_merge($this->filenames, $filename_array); return $this; } diff --git a/tests/template/template_parser_test.php b/tests/template/template_parser_test.php new file mode 100644 index 0000000000..aa7a9412d6 --- /dev/null +++ b/tests/template/template_parser_test.php @@ -0,0 +1,29 @@ +template->set_filenames(array( + 'basic' => 'basic.html', + )); + + $this->assertEquals("passpasspass", str_replace(array("\n", "\r", "\t"), '', $this->template->assign_display('basic'))); + + $this->template->set_filenames(array( + 'basic' => 'if.html', + )); + + $this->assertEquals("03!false", str_replace(array("\n", "\r", "\t"), '', $this->template->assign_display('basic'))); + } +}