]> source.dussan.org Git - nextcloud-server.git/commitdiff
Catch exception from path info 3573/head
authorJoas Schilling <coding@schilljs.com>
Wed, 22 Feb 2017 10:01:40 +0000 (11:01 +0100)
committerJoas Schilling <coding@schilljs.com>
Wed, 22 Feb 2017 10:08:58 +0000 (11:08 +0100)
We don't really care when the path info can not be gathered correctly.
we will simply not use SCSS then but the CSS fallback.

Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/TemplateLayout.php

index f1621363237a59ed506ab6086aa9393002090413..ccd53c9cafabf6bb51f5f087dc258b64e136aa0c 100644 (file)
@@ -159,11 +159,18 @@ class TemplateLayout extends \OC_Template {
                        $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
                }
 
+               try {
+                       $pathInfo = \OC::$server->getRequest()->getPathInfo();
+               } catch (\Exception $e) {
+                       $pathInfo = '';
+               }
+
                // Do not initialise scss appdata until we have a fully installed instance
                // Do not load scss for update, errors, installation or login page
                if(\OC::$server->getSystemConfig()->getValue('installed', false)
                        && !\OCP\Util::needUpgrade()
-                       && !preg_match('/^\/login/', \OC::$server->getRequest()->getPathInfo())) {
+                       && $pathInfo !== ''
+                       && !preg_match('/^\/login/', $pathInfo)) {
                        $cssFiles = self::findStylesheetFiles(\OC_Util::$styles);
                } else {
                        // If we ignore the scss compiler,