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>
This commit is contained in:
Joas Schilling 2017-02-22 11:01:40 +01:00
parent d3f774d035
commit 899af7831e
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 8 additions and 1 deletions

View 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,