From 2c9d7eeb763d2f907eea8234f6c60a829a5d39f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 1 Feb 2017 17:57:19 +0100 Subject: [PATCH] Fix public page css fallback loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/Controller/LoginController.php | 2 -- core/Controller/SetupController.php | 1 - lib/base.php | 4 ---- lib/private/TemplateLayout.php | 6 +++++- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 52bd221395..28cc39b913 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -169,8 +169,6 @@ class LoginController extends Controller { $parameters['user_autofocus'] = true; } - \OC_Util::addStyle('guest'); - return new TemplateResponse( $this->appName, 'login', $parameters, 'guest' ); diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index 87508423cd..bb7c8c4969 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -92,7 +92,6 @@ class SetupController { \OC_Util::addVendorScript('strengthify/jquery.strengthify'); \OC_Util::addVendorStyle('strengthify/strengthify'); - \OC_Util::addStyle('guest'); \OC_Util::addScript('setup'); \OC_Template::printGuestPage('', 'installation', $parameters); } diff --git a/lib/base.php b/lib/base.php index 3ba0755eaa..9f480c0b0d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -281,7 +281,6 @@ class OC { // render error page $template = new OC_Template('', 'update.user', 'guest'); OC_Util::addScript('maintenance-check'); - OC_Util::addStyle('guest'); $template->printPage(); die(); } @@ -355,8 +354,6 @@ class OC { header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 120'); - OC_Util::addStyle('guest'); - // render error page $template = new OC_Template('', 'update.use-cli', 'guest'); $template->assign('productName', 'nextcloud'); // for now @@ -378,7 +375,6 @@ class OC { $systemConfig->setValue('theme', ''); OC_Util::addScript('config'); // needed for web root OC_Util::addScript('update'); - OC_Util::addStyle('guest'); /** @var \OC\App\AppManager $appManager */ $appManager = \OC::$server->getAppManager(); diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 7ded109f76..19fc946218 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -164,11 +164,15 @@ class TemplateLayout extends \OC_Template { // Do not load scss for update, errors, installation or login page if(\OC::$server->getSystemConfig()->getValue('installed', false) && !\OCP\Util::needUpgrade() - && strpos(\OC::$server->getRequest()->getRequestUri(), \OC::$server->getURLGenerator()->linkToRoute('core.login.tryLogin')) !== 0) { + && !preg_match('/^\/login/', \OC::$server->getRequest()->getPathInfo())) { $cssFiles = self::findStylesheetFiles(\OC_Util::$styles); } else { + // If we ignore the scss compiler, + // we need to load the guest css fallback + \OC_Util::addStyle('guest'); $cssFiles = self::findStylesheetFiles(\OC_Util::$styles, false); } + $this->assign('cssfiles', array()); $this->assign('printcssfiles', []); $this->assign('versionHash', self::$versionHash);