diff options
author | Joas Schilling <coding@schilljs.com> | 2017-02-22 11:01:40 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-02-22 11:08:58 +0100 |
commit | 899af7831ecd99b31a99e5aa3c6948f4bb550415 (patch) | |
tree | 4c88862a5738057de149c47ac3b4e9f8ed2ce5d5 /lib/private/TemplateLayout.php | |
parent | d3f774d0353052730fc079751fa8991e858f52c9 (diff) | |
download | nextcloud-server-899af7831ecd99b31a99e5aa3c6948f4bb550415.tar.gz nextcloud-server-899af7831ecd99b31a99e5aa3c6948f4bb550415.zip |
Catch exception from path info
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>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r-- | lib/private/TemplateLayout.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index f1621363237..ccd53c9cafa 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -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, |