diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-09-07 09:37:49 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-09-07 09:37:49 +0200 |
commit | a9f39bf500d7fc9b3ef2d3c4ade6c46946999195 (patch) | |
tree | 6197cf29fe8c16bbf278e0e63472d7ea07a21ca6 /lib/private/TemplateLayout.php | |
parent | 16e1d1cb12229270d61d89dfda93399d056d456c (diff) | |
download | nextcloud-server-a9f39bf500d7fc9b3ef2d3c4ade6c46946999195.tar.gz nextcloud-server-a9f39bf500d7fc9b3ef2d3c4ade6c46946999195.zip |
Make sure that getConfig is still called for browsers that do not support CSPv3
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r-- | lib/private/TemplateLayout.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 4a0ec75b517..e8ebee82a5d 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -194,21 +194,22 @@ class TemplateLayout extends \OC_Template { $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts); $this->assign('jsfiles', []); if ($this->config->getSystemValue('installed', false) && $renderAs != TemplateResponse::RENDER_AS_ERROR) { + $jsConfigHelper = new JSConfigHelper( + \OC::$server->getL10N('lib'), + \OC::$server->query(Defaults::class), + \OC::$server->getAppManager(), + \OC::$server->getSession(), + \OC::$server->getUserSession()->getUser(), + $this->config, + \OC::$server->getGroupManager(), + \OC::$server->get(IniGetWrapper::class), + \OC::$server->getURLGenerator(), + \OC::$server->getCapabilitiesManager(), + \OC::$server->query(IInitialStateService::class) + ); + $config = $jsConfigHelper->getConfig(); if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) { - $jsConfigHelper = new JSConfigHelper( - \OC::$server->getL10N('lib'), - \OC::$server->query(Defaults::class), - \OC::$server->getAppManager(), - \OC::$server->getSession(), - \OC::$server->getUserSession()->getUser(), - $this->config, - \OC::$server->getGroupManager(), - \OC::$server->get(IniGetWrapper::class), - \OC::$server->getURLGenerator(), - \OC::$server->getCapabilitiesManager(), - \OC::$server->query(IInitialStateService::class) - ); - $this->assign('inline_ocjs', $jsConfigHelper->getConfig()); + $this->assign('inline_ocjs', $config); } else { $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); } |