From a5ba9279c4b4fa4752f174ba2afbba970e72274c Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 12 Mar 2012 23:17:20 +0000 Subject: [PATCH] modification dates on CSS/JS links --- core/page.class.php | 10 +++++----- core/util.inc.php | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/page.class.php b/core/page.class.php index 3761f4b2..48719ef1 100644 --- a/core/page.class.php +++ b/core/page.class.php @@ -251,28 +251,28 @@ class Page { // caching failed, add all files to html_headers. foreach(glob("lib/*.css") as $css) { - $this->add_html_header(''); + $this->add_html_header(''); } $css_files = glob("ext/*/style.css"); if($css_files) { foreach($css_files as $css_file) { - $this->add_html_header(''); + $this->add_html_header(''); } } $css_files = glob("themes/$theme_name/style.css"); if($css_files) { foreach($css_files as $css_file) { - $this->add_html_header(''); + $this->add_html_header(''); } } foreach(glob("lib/*.js") as $js) { - $this->add_html_header(''); + $this->add_html_header(''); } $js_files = glob("ext/*/script.js"); if($js_files) { foreach($js_files as $js_file) { - $this->add_html_header(''); + $this->add_html_header(''); } } } diff --git a/core/util.inc.php b/core/util.inc.php index e9a8583d..552266be 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -339,6 +339,13 @@ function make_form($target, $method="POST", $multipart=False, $form_id="", $onsu return '
'.$auth; } +function mtimefile($file) { + $data_href = get_base_href(); + $mtime = filemtime($file); + return "$data_href/$file?$mtime"; +} + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * CAPTCHA abstraction *