Skip to content
Snippets Groups Projects
Commit 83403784 authored by Bart Visscher's avatar Bart Visscher
Browse files

Always load when the requested file is css

parent da07245f
No related branches found
No related tags found
No related merge requests found
...@@ -398,9 +398,8 @@ class OC{ ...@@ -398,9 +398,8 @@ class OC{
header('location: '.OC_Helper::linkToRemote('webdav')); header('location: '.OC_Helper::linkToRemote('webdav'));
return true; return true;
} }
if(!OC_User::isLoggedIn() && substr(OC::$REQUESTEDFILE,-3) == 'css') { if(substr(OC::$REQUESTEDFILE,-3) == 'css') {
OC_App::loadApps(); self::loadCSSFile();
self::loadfile();
return true; return true;
} }
// Someone is logged in : // Someone is logged in :
...@@ -436,14 +435,7 @@ class OC{ ...@@ -436,14 +435,7 @@ class OC{
$app_path = OC_App::getAppPath($app); $app_path = OC_App::getAppPath($app);
if (file_exists($app_path . '/' . $file)) { if (file_exists($app_path . '/' . $file)) {
$file_ext = substr($file, -3); $file_ext = substr($file, -3);
if ($file_ext == 'css') { if ($file_ext == 'php') {
$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') {
$file = $app_path . '/' . $file; $file = $app_path . '/' . $file;
unset($app, $app_path, $app_web_path, $file_ext); unset($app, $app_path, $app_web_path, $file_ext);
require_once($file); require_once($file);
...@@ -456,6 +448,19 @@ class OC{ ...@@ -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() { public static function tryRememberLogin() {
if(!isset($_COOKIE["oc_remember_login"]) if(!isset($_COOKIE["oc_remember_login"])
|| !isset($_COOKIE["oc_token"]) || !isset($_COOKIE["oc_token"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment