aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-04-19 13:38:06 +0200
committerMario Vavti <mario@mariovavti.com>2016-04-19 13:38:06 +0200
commit6941fbb182dd7b91c2bc5c1de387affa746d97f6 (patch)
treed0d387a47665f2b7f676ec41e3b5da843f761b09
parentf53478f1427fb90538168bbf787efb2dd2b38682 (diff)
downloadvolse-hubzilla-6941fbb182dd7b91c2bc5c1de387affa746d97f6.tar.gz
volse-hubzilla-6941fbb182dd7b91c2bc5c1de387affa746d97f6.tar.bz2
volse-hubzilla-6941fbb182dd7b91c2bc5c1de387affa746d97f6.zip
add querystring to css and js which is added via head_add_{css, js}
-rwxr-xr-xinclude/plugin.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 8dceb8fb1..7df3e302c 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -535,8 +535,11 @@ function format_css_if_exists($source) {
else
$path = theme_include($source[0]);
- if($path)
- return '<link rel="stylesheet" href="' . script_path() . '/' . $path . '" type="text/css" media="' . $source[1] . '">' . "\r\n";
+ if($path) {
+ $path = script_path() . '/' . $path;
+ $qstring = ((parse_url($path, PHP_URL_QUERY)) ? '&' : '?') . 'v=' . STD_VERSION;
+ return '<link rel="stylesheet" href="' . $path . $qstring . '" type="text/css" media="' . $source[1] . '">' . "\r\n";
+ }
}
/*
@@ -612,8 +615,11 @@ function format_js_if_exists($source) {
$path = $source;
else
$path = theme_include($source);
- if($path)
- return '<script src="' . script_path() . '/' . $path . '" ></script>' . "\r\n" ;
+ if($path) {
+ $path = script_path() . '/' . $path;
+ $qstring = ((parse_url($path, PHP_URL_QUERY)) ? '&' : '?') . 'v=' . STD_VERSION;
+ return '<script src="' . $path . $qstring . '" ></script>' . "\r\n" ;
+ }
}
@@ -678,4 +684,4 @@ function folder_exists($folder)
// If it exist, check if it's a directory
return (($path !== false) && is_dir($path)) ? $path : false;
-} \ No newline at end of file
+}