Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2018-12-19 21:42:19 +0300
committerPhie <phie@phie.ovh>2018-12-19 21:42:19 +0300
commit081e16a0708a795296d5f125e06ff6f5ec11e2cf (patch)
treecfac32d6638e438f9488c648d1bce3908e99db1b /templates
parent75fbe1e8776141f39f2bac92a9208a58c1608c94 (diff)
also refresh cache for css
Diffstat (limited to 'templates')
m---------templates/CarnetElectron0
-rwxr-xr-xtemplates/index.php6
-rwxr-xr-xtemplates/writer.php9
3 files changed, 14 insertions, 1 deletions
diff --git a/templates/CarnetElectron b/templates/CarnetElectron
-Subproject 74f8b253878c0efc560f1bee8f1c4c5a39e99d2
+Subproject 7aa06d678a561d19847711183fa15a1b9560d7f
diff --git a/templates/index.php b/templates/index.php
index a6375bd..b3e1d8f 100755
--- a/templates/index.php
+++ b/templates/index.php
@@ -9,8 +9,12 @@ if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS
}
$file = file_get_contents($currentpath."index.html");
//
-$file = str_replace("href=\"","href=\"".$root."/CarnetElectron/",$file);
+$file = preg_replace_callback('/<link(.*?)href=\"(.*?\.css(?:\?.*?)?)"/s',function ($matches) {
+ global $currentpath;
+ return "<link".$matches[1]."href=\"".$matches[2]."?mtime=".filemtime($currentpath.$matches[2])."\"";
+}, $file);
+$file = str_replace("href=\"","href=\"".$root."/CarnetElectron/",$file);
$file = preg_replace_callback('/<script(.*?)src=\"(.*?\.js(?:\?.*?)?)"/s',function ($matches) {
global $currentpath;
diff --git a/templates/writer.php b/templates/writer.php
index ee6606d..3c9cb8f 100755
--- a/templates/writer.php
+++ b/templates/writer.php
@@ -16,6 +16,15 @@ $file = preg_replace_callback('/<script(.*?)src=\"(.*?\.js(?:\?.*?)?)"/s',functi
$relativePath = str_replace("<!ROOTPATH>", "", $matches[2]);
return "<script".$matches[1]."src=\"".$src."?mtime=".filemtime($currentpath.$relativePath)."\"";
}, $file);
+
+$file = preg_replace_callback('/<link(.*?)href=\"(.*?\.css(?:\?.*?)?)"/s',function ($matches) {
+ global $currentpath;
+ global $root;
+ $src = str_replace("<!ROOTPATH>", $root."/CarnetElectron/", $matches[2]);
+ $relativePath = str_replace("<!ROOTPATH>", "", $matches[2]);
+ return "<link".$matches[1]."href=\"".$src."?mtime=".filemtime($currentpath.$relativePath)."\"";
+}, $file);
+
$file = str_replace("<!ROOTPATH>", $root."/CarnetElectron/", $file);
$root = substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT']));