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
8c2c8fd831
commit
9b33e3caee
|
@ -173,7 +173,6 @@ class TemplateLayout extends \OC_Template {
|
||||||
$jsFiles = self::findJavascriptFiles(\OC_Util::$scripts);
|
$jsFiles = self::findJavascriptFiles(\OC_Util::$scripts);
|
||||||
$this->assign('jsfiles', []);
|
$this->assign('jsfiles', []);
|
||||||
if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
|
if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
|
||||||
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
|
|
||||||
$jsConfigHelper = new JSConfigHelper(
|
$jsConfigHelper = new JSConfigHelper(
|
||||||
\OC::$server->getL10N('lib'),
|
\OC::$server->getL10N('lib'),
|
||||||
\OC::$server->query(Defaults::class),
|
\OC::$server->query(Defaults::class),
|
||||||
|
@ -187,7 +186,10 @@ class TemplateLayout extends \OC_Template {
|
||||||
\OC::$server->getCapabilitiesManager(),
|
\OC::$server->getCapabilitiesManager(),
|
||||||
\OC::$server->query(IInitialStateService::class)
|
\OC::$server->query(IInitialStateService::class)
|
||||||
);
|
);
|
||||||
|
$config = $jsConfigHelper->getConfig();
|
||||||
|
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
|
||||||
$this->assign('inline_ocjs', $jsConfigHelper->getConfig());
|
$this->assign('inline_ocjs', $jsConfigHelper->getConfig());
|
||||||
|
$this->assign('inline_ocjs', $config);
|
||||||
} else {
|
} else {
|
||||||
$this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash]));
|
$this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash]));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue