]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure that getConfig is still called for browsers that do not support CSPv3 22636/head
authorJulius Härtl <jus@bitgrid.net>
Mon, 7 Sep 2020 07:37:49 +0000 (09:37 +0200)
committerJulius Härtl <jus@bitgrid.net>
Mon, 7 Sep 2020 07:37:49 +0000 (09:37 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/TemplateLayout.php

index 4a0ec75b5178990bf49085ec5ba447a41f09c090..e8ebee82a5d4bd6b958d73a865ef88428af0a9aa 100644 (file)
@@ -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]));
                        }