aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/style
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-04-13 04:03:07 +0200
committerNils Adermann <naderman@naderman.de>2012-04-13 04:08:21 +0200
commit8a1d084d6d00500b3ea17a7fd3168ec4f321b31b (patch)
tree1651982ffc87deb1f3febf27a542d1cba701842d /phpBB/includes/style
parent790cc0c54f0f84235a556e4442c42d9d1d5f7195 (diff)
downloadforums-8a1d084d6d00500b3ea17a7fd3168ec4f321b31b.tar
forums-8a1d084d6d00500b3ea17a7fd3168ec4f321b31b.tar.gz
forums-8a1d084d6d00500b3ea17a7fd3168ec4f321b31b.tar.bz2
forums-8a1d084d6d00500b3ea17a7fd3168ec4f321b31b.tar.xz
forums-8a1d084d6d00500b3ea17a7fd3168ec4f321b31b.zip
[ticket/10783] Correctly add assets_version config var to includejs urls
PHPBB3-10783
Diffstat (limited to 'phpBB/includes/style')
-rw-r--r--phpBB/includes/style/template.php3
-rw-r--r--phpBB/includes/style/template_filter.php10
2 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/includes/style/template.php b/phpBB/includes/style/template.php
index 3f15355f7a..9d476e74b9 100644
--- a/phpBB/includes/style/template.php
+++ b/phpBB/includes/style/template.php
@@ -507,6 +507,9 @@ class phpbb_style_template
$file = $this->locator->get_first_file_location(array($file), true, true);
}
+ $file .= (strpos($file, '?') === false) ? '?' : '&';
+ $file .= 'assets_version=' . $this->config['assets_version'];
+
// Add HTML code
$code = '<script src="' . htmlspecialchars($file) . '"></script>';
$this->context->append_var('SCRIPTS', $code);
diff --git a/phpBB/includes/style/template_filter.php b/phpBB/includes/style/template_filter.php
index f9bbcce4b2..6ef9d80a3d 100644
--- a/phpBB/includes/style/template_filter.php
+++ b/phpBB/includes/style/template_filter.php
@@ -138,7 +138,7 @@ class phpbb_style_template_filter extends php_user_filter
/**
* Initializer, called on creation.
*
- * Get the allow_php option, root directory and locator from params,
+ * Get the allow_php option, root directory and locator from params,
* which are passed to stream_filter_append.
*/
public function onCreate()
@@ -882,8 +882,6 @@ class phpbb_style_template_filter extends php_user_filter
*/
private function compile_tag_include_js($tag_args)
{
- global $config;
-
// Process dynamic includes
if ($tag_args[0] == '{')
{
@@ -896,14 +894,14 @@ class phpbb_style_template_filter extends php_user_filter
}
// Locate file
- $filename = $this->locator->get_first_file_location(array($tag_args), false, true) . '?assets_version=' . $config['assets_version'];
-
+ $filename = $this->locator->get_first_file_location(array($tag_args), false, true);
+
if ($filename === false)
{
// File does not exist, find it during run time
return ' $_template->_js_include(\'' . addslashes($tag_args) . '\', true); ';
}
-
+
if (substr($filename, 0, strlen($this->phpbb_root_path)) != $this->phpbb_root_path)
{
// Absolute path, include as is