diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-21 20:41:14 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-21 20:41:14 +0100 |
commit | 95a8f400529a26b403cb22f8b71106780f31d21e (patch) | |
tree | 95ad3c2a09b13c09bb6b807a5167ada08f3bc505 /phpBB/phpbb/template | |
parent | a1917086017e3d59f229223edf52eddd72a08b24 (diff) | |
parent | 1689191f29ded2037d126d58d691752bb0afe697 (diff) | |
download | forums-95a8f400529a26b403cb22f8b71106780f31d21e.tar forums-95a8f400529a26b403cb22f8b71106780f31d21e.tar.gz forums-95a8f400529a26b403cb22f8b71106780f31d21e.tar.bz2 forums-95a8f400529a26b403cb22f8b71106780f31d21e.tar.xz forums-95a8f400529a26b403cb22f8b71106780f31d21e.zip |
Merge branch 'develop-ascraeus' into develop
Diffstat (limited to 'phpBB/phpbb/template')
-rw-r--r-- | phpBB/phpbb/template/twig/twig.php | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 2a8fb76b90..4962d14aef 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -170,13 +170,24 @@ class twig extends \phpbb\template\base { $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/"; $template_path = $path . 'template/'; + $theme_path = $path . 'theme/'; + $is_valid_dir = false; if (is_dir($template_path)) { + $is_valid_dir = true; + $paths[] = $template_path; + } + if (is_dir($theme_path)) + { + $is_valid_dir = true; + $paths[] = $theme_path; + } + + if ($is_valid_dir) + { // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($path); - - $paths[] = $template_path; } } } @@ -234,25 +245,38 @@ class twig extends \phpbb\template\base { $ext_style_template_path = $ext_path . $template_dir['ext_path']; $ext_style_path = dirname($ext_style_template_path); + $ext_style_theme_path = $ext_style_path . 'theme/'; } else { $ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/'; $ext_style_template_path = $ext_style_path . 'template/'; + $ext_style_theme_path = $ext_style_path . 'theme/'; } } else { $ext_style_path = $ext_path . 'styles/' . $template_dir . '/'; $ext_style_template_path = $ext_style_path . 'template/'; + $ext_style_theme_path = $ext_style_path . 'theme/'; } + $ok = false; if (is_dir($ext_style_template_path)) { + $ok = true; + $paths[] = $ext_style_template_path; + } + if (is_dir($ext_style_theme_path)) + { + $ok = true; + $paths[] = $ext_style_theme_path; + } + + if ($ok) + { // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($ext_style_path); - - $paths[] = $ext_style_template_path; } } |