diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-09-07 09:37:49 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-09-17 10:18:30 +0200 |
commit | 9b33e3caeef4a1da837ffaa509ac6929f5ee3135 (patch) | |
tree | 828b4bd68ae85821df254b1cdb205967df9530ae /lib | |
parent | 8c2c8fd8311dadb77e2b07512811ba47487ef496 (diff) | |
download | nextcloud-server-9b33e3caeef4a1da837ffaa509ac6929f5ee3135.tar.gz nextcloud-server-9b33e3caeef4a1da837ffaa509ac6929f5ee3135.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')
-rw-r--r-- | lib/private/TemplateLayout.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 1fbf0acb99c..ab64c827613 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -173,21 +173,23 @@ class TemplateLayout extends \OC_Template { $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts); $this->assign('jsfiles', []); if ($this->config->getSystemValue('installed', false) && $renderAs != '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->getIniWrapper(), + \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->getIniWrapper(), - \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])); } |