X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fvier%2Fstyle.php;h=d777864825a11cf98b2aeb1d692ab1567b44d7b4;hb=2022d0e812d191acd47b8408f933dfb726a21b92;hp=3d3c776745de4c86a02527d334a0eab9a811b61f;hpb=2c69614950f17edbe208b386bbbfd8fb7c441e57;p=friendica.git diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php index 3d3c776745..d777864825 100644 --- a/view/theme/vier/style.php +++ b/view/theme/vier/style.php @@ -1,36 +1,39 @@ $modified) - $modified = $stylemodified; +if (empty($style)) { + $style = "plus"; +} +$stylecss = ''; +$modified = ''; + +foreach (['style', $style] as $file) { + $stylecssfile = $THEMEPATH . DIRECTORY_SEPARATOR . $file .'.css'; + if (file_exists($stylecssfile)) { + $stylecss .= file_get_contents($stylecssfile); + $stylemodified = filemtime($stylecssfile); + if ($stylemodified > $modified) { + $modified = $stylemodified; + } + } else { + //TODO: use LOGGER_ERROR? + logger('Error: missing file: "' . $stylecssfile .'" (userid: '. $uid .')'); + } +} $modified = gmdate('r', $modified); $etag = md5($stylecss); @@ -41,12 +44,11 @@ header('ETag: "'.$etag.'"'); header('Last-Modified: '.$modified); if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) { - $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])); - $cached_etag = str_replace(array('"', "-gzip"), array('', ''), + $cached_etag = str_replace(['"', "-gzip"], ['', ''], stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); - if (($cached_modified == $modified) AND ($cached_etag == $etag)) { + if (($cached_modified == $modified) && ($cached_etag == $etag)) { header('HTTP/1.1 304 Not Modified'); exit(); }