aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-10-05 18:39:23 +0200
committerTristan Darricau <github@nicofuma.fr>2014-10-08 18:25:36 +0200
commit911831a9c5d7971ec8c6155360115246c9a871e0 (patch)
tree2c7bfe0c4a00d25ac7439e5319cdc474241dfff3 /phpBB/phpbb/template
parent5b186c936d6d6d67b8b0551a990522fdc68e2a4c (diff)
downloadforums-911831a9c5d7971ec8c6155360115246c9a871e0.tar
forums-911831a9c5d7971ec8c6155360115246c9a871e0.tar.gz
forums-911831a9c5d7971ec8c6155360115246c9a871e0.tar.bz2
forums-911831a9c5d7971ec8c6155360115246c9a871e0.tar.xz
forums-911831a9c5d7971ec8c6155360115246c9a871e0.zip
[ticket/13133] Allow @vendor_name for includecss
PHPBB3-13133
Diffstat (limited to 'phpBB/phpbb/template')
-rw-r--r--phpBB/phpbb/template/twig/twig.php32
1 files changed, 28 insertions, 4 deletions
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index a3b002f350..84d5450d98 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -189,13 +189,24 @@ class twig extends \phpbb\template\base
{
$path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/";
$template_path = $path . 'template/';
+ $theme_path = $path . 'theme/';
+ $ok = false;
if (is_dir($template_path))
{
+ $ok = true;
+ $paths[] = $template_path;
+ }
+ if (is_dir($theme_path))
+ {
+ $ok = true;
+ $paths[] = $theme_path;
+ }
+
+ if ($ok)
+ {
// Add the base style directory as a safe directory
$this->twig->getLoader()->addSafeDirectory($path);
-
- $paths[] = $template_path;
}
}
}
@@ -253,25 +264,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;
}
}