From 6941fbb182dd7b91c2bc5c1de387affa746d97f6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 19 Apr 2016 13:38:06 +0200 Subject: add querystring to css and js which is added via head_add_{css, js} --- include/plugin.php | 16 +++++++++++----- 1 file 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 '' . "\r\n"; + if($path) { + $path = script_path() . '/' . $path; + $qstring = ((parse_url($path, PHP_URL_QUERY)) ? '&' : '?') . 'v=' . STD_VERSION; + return '' . "\r\n"; + } } /* @@ -612,8 +615,11 @@ function format_js_if_exists($source) { $path = $source; else $path = theme_include($source); - if($path) - return '' . "\r\n" ; + if($path) { + $path = script_path() . '/' . $path; + $qstring = ((parse_url($path, PHP_URL_QUERY)) ? '&' : '?') . 'v=' . STD_VERSION; + return '' . "\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 +} -- cgit v1.2.3