From ec31d93af2aef6123b282e3082e108ed27112266 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 28 Jan 2020 18:56:54 +0100 Subject: [PATCH] do NOT load categories.php?app=phpgw for login page It gives an error as no user is logged in, which is served as text/html, which then gives an error in browser, as it conflicts with X-Content-Type-Options: nosniff --- api/src/Framework.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/api/src/Framework.php b/api/src/Framework.php index f2c73f263c..b1100ed252 100644 --- a/api/src/Framework.php +++ b/api/src/Framework.php @@ -96,7 +96,7 @@ abstract class Framework extends Framework\Extra /** * Factory method to instanciate framework object * - * @return egw_framwork + * @return self */ public static function factory() { @@ -932,7 +932,10 @@ abstract class Framework extends Framework\Extra self::includeCSS($theme_min_css); // Global category styles - Categories::css(Categories::GLOBAL_APPNAME); + if (basename($_SERVER['PHP_SELF']) !== 'login.php') + { + Categories::css(Categories::GLOBAL_APPNAME); + } } else { @@ -949,7 +952,10 @@ abstract class Framework extends Framework\Extra self::includeCSS('/api/templates/default/etemplate2.css'); // Category styles - Categories::css(Categories::GLOBAL_APPNAME); + if (basename($_SERVER['PHP_SELF']) !== 'login.php') + { + Categories::css(Categories::GLOBAL_APPNAME); + } self::includeCSS($theme_css);