From 83403784d163411856e8ab6e711c319e36040f56 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Fri, 10 Aug 2012 00:58:57 +0200
Subject: [PATCH] Always load when the requested file is css

---
 lib/base.php | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/lib/base.php b/lib/base.php
index 69de28db4a..5132a82292 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"])
-- 
GitLab