Merge pull request #22904 from nextcloud/backport/22636/stable19
[stable19] Make sure that getConfig is still called for browsers that do not support CSPv3
This commit is contained in:
commit
ed22e1bf3b
|
@ -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]));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue