]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix errors for minimizer
authorBart Visscher <bartv@thisnet.nl>
Mon, 18 Jun 2012 09:33:24 +0000 (11:33 +0200)
committerBart Visscher <bartv@thisnet.nl>
Mon, 18 Jun 2012 09:33:24 +0000 (11:33 +0200)
lib/base.php
lib/cache/fileglobal.php
lib/request.php

index 30f7e5bba63e23a554bbe80dee0c3a1c17e9869a..94ae26c4d1ba347628aacde021054fc06b6a9221 100644 (file)
@@ -282,7 +282,7 @@ class OC{
                        if(substr(OC::$REQUESTEDFILE, -3) == 'css'){
                                $file = 'apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE;
                                $minimizer = new OC_Minimizer_CSS();
-                               $minimizer->output(array(array(OC::$APPSROOT, OC::$APPSWEBROOT, $file)));
+                               $minimizer->output(array(array(OC::$APPSROOT, OC::$APPSWEBROOT, $file)), $file);
                                exit;
                        }elseif(substr(OC::$REQUESTEDFILE, -3) == 'php'){
                                require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
index 469dd4b6dd4eab1f647e7fd777e82ae78b9d31fa..1c2c9bdc82d293890296b750476ce22b5a91b9a5 100644 (file)
@@ -16,7 +16,12 @@ class OC_Cache_FileGlobal{
                return $cache_dir;
        }
 
+       protected function fixKey($key) {
+               return str_replace('/', '_', $key);
+       }
+
        public function get($key) {
+               $key = $this->fixKey($key);
                if ($this->hasKey($key)) {
                        $cache_dir = $this->getCacheDir();
                        return file_get_contents($cache_dir.$key);
@@ -25,6 +30,7 @@ class OC_Cache_FileGlobal{
        }
 
        public function set($key, $value, $ttl=0) {
+               $key = $this->fixKey($key);
                $cache_dir = $this->getCacheDir();
                if ($cache_dir and file_put_contents($cache_dir.$key, $value)) {
                        if ($ttl === 0) {
@@ -36,6 +42,7 @@ class OC_Cache_FileGlobal{
        }
 
        public function hasKey($key) {
+               $key = $this->fixKey($key);
                $cache_dir = $this->getCacheDir();
                if ($cache_dir && is_file($cache_dir.$key)) {
                        $mtime = filemtime($cache_dir.$key);
@@ -53,6 +60,7 @@ class OC_Cache_FileGlobal{
                if(!$cache_dir){
                        return false;
                }
+               $key = $this->fixKey($key);
                return unlink($cache_dir.$key);
        }
 
index d152d0c73ba3dfc8aceb3ec7ff120e69d521ade2..0b5aaf8ef3043adca0ae6ca921a91b58ae01a4e0 100644 (file)
@@ -15,6 +15,9 @@ class OC_Request {
        }
 
        static public function acceptGZip() {
+               if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
+                       return false;
+               }
                $HTTP_ACCEPT_ENCODING = $_SERVER["HTTP_ACCEPT_ENCODING"];
                if( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false )
                        return 'x-gzip';