diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-08-10 00:58:57 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-08-10 11:43:04 +0200 |
commit | 83403784d163411856e8ab6e711c319e36040f56 (patch) | |
tree | 5816f63b1999d06c2c068eda9a02ee5c74ebfabb /lib/base.php | |
parent | da07245f59cd3a1636392f63ef89e91b40d792eb (diff) | |
download | nextcloud-server-83403784d163411856e8ab6e711c319e36040f56.tar.gz nextcloud-server-83403784d163411856e8ab6e711c319e36040f56.zip |
Always load when the requested file is css
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/base.php b/lib/base.php index 69de28db4a0..5132a822927 100644 --- a/lib/base.php +++ b/lib/base.php @@ -398,9 +398,8 @@ class OC{ header('location: '.OC_Helper::linkToRemote('webdav')); return true; } - if(!OC_User::isLoggedIn() && substr(OC::$REQUESTEDFILE,-3) == 'css') { - OC_App::loadApps(); - self::loadfile(); + if(substr(OC::$REQUESTEDFILE,-3) == 'css') { + self::loadCSSFile(); return true; } // Someone is logged in : @@ -436,14 +435,7 @@ class OC{ $app_path = OC_App::getAppPath($app); if (file_exists($app_path . '/' . $file)) { $file_ext = substr($file, -3); - if ($file_ext == 'css') { - $app_web_path = OC_App::getAppWebPath($app); - $filepath = $app_web_path . '/' . $file; - $minimizer = new OC_Minimizer_CSS(); - $info = array($app_path, $app_web_path, $file); - $minimizer->output(array($info), $filepath); - exit; - } elseif($file_ext == 'php') { + if ($file_ext == 'php') { $file = $app_path . '/' . $file; unset($app, $app_path, $app_web_path, $file_ext); require_once($file); @@ -456,6 +448,19 @@ class OC{ } } + protected static function loadCSSFile() { + $app = OC::$REQUESTEDAPP; + $file = OC::$REQUESTEDFILE; + $app_path = OC_App::getAppPath($app); + if (file_exists($app_path . '/' . $file)) { + $app_web_path = OC_App::getAppWebPath($app); + $filepath = $app_web_path . '/' . $file; + $minimizer = new OC_Minimizer_CSS(); + $info = array($app_path, $app_web_path, $file); + $minimizer->output(array($info), $filepath); + } + } + public static function tryRememberLogin() { if(!isset($_COOKIE["oc_remember_login"]) || !isset($_COOKIE["oc_token"]) |