Make sure that getConfig is still called for browsers that do not support CSPv3
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
16e1d1cb12
commit
a9f39bf500
|
@ -194,7 +194,6 @@ 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) {
|
||||
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
|
||||
$jsConfigHelper = new JSConfigHelper(
|
||||
\OC::$server->getL10N('lib'),
|
||||
\OC::$server->query(Defaults::class),
|
||||
|
@ -208,7 +207,9 @@ class TemplateLayout extends \OC_Template {
|
|||
\OC::$server->getCapabilitiesManager(),
|
||||
\OC::$server->query(IInitialStateService::class)
|
||||
);
|
||||
$this->assign('inline_ocjs', $jsConfigHelper->getConfig());
|
||||
$config = $jsConfigHelper->getConfig();
|
||||
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
|
||||
$this->assign('inline_ocjs', $config);
|
||||
} else {
|
||||
$this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash]));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue