Skip to content

Commit

Permalink
Merge pull request phpbb#4990 from rubencm/ticket/15377
Browse files Browse the repository at this point in the history
[ticket/15377] Fix INCLUDECSS and INCLUDEJS
  • Loading branch information
CHItA authored Oct 9, 2017
2 parents eb0122b + eaeec9b commit 68b3da2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions phpBB/phpbb/template/twig/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ class loader extends \Twig_Loader_Filesystem
{
protected $safe_directories = array();

/**
* Constructor
*
* @param string|array $paths
*/
public function __construct($paths = array())
{
parent::__construct($paths, __DIR__);
}

/**
* Set safe directories
*
Expand Down
9 changes: 9 additions & 0 deletions tests/functional/extension_controller_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public function test_controller_with_template()
$this->phpbb_extension_manager->purge('foo/bar');
}

/**
* Check includejs/includecss when the request_uri is a subdirectory
*/
public function test_controller_template_include_js_css()
{
$crawler = self::request('GET', 'app.php/help/faq');
$this->assertContains("./../../assets/javascript/core.js", $crawler->filter('body')->html());
}

/**
* Check the error produced by calling a controller without a required
* argument.
Expand Down

0 comments on commit 68b3da2

Please sign in to comment.