mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 12:32:40 +08:00
Bugfix solution #537 for cached template
This commit is contained in:
parent
c83cf64b80
commit
ade75b4cbe
1 changed files with 5 additions and 7 deletions
|
@ -180,14 +180,8 @@ abstract class Service
|
|||
if ($sResult) {
|
||||
$sResult .= '<!--cached-->';
|
||||
} else {
|
||||
$SameSite = \strtolower($oConfig->Get('security', 'cookie_samesite', 'Strict'));
|
||||
$Secure = (isset($_SERVER['HTTPS']) || 'none' == $SameSite) ? ';secure' : '';
|
||||
$aTemplateParameters['{{BaseAppBootCss}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot'.$sAppCssMin.'.css');
|
||||
$aTemplateParameters['{{BaseAppBootScript}}'] = \str_replace(
|
||||
'samesite=strict',
|
||||
"samesite={$SameSite}{$Secure}",
|
||||
\file_get_contents(APP_VERSION_ROOT_PATH.'static/js'.($sAppJsMin ? '/min' : '').'/boot'.$sAppJsMin.'.js')
|
||||
);
|
||||
$aTemplateParameters['{{BaseAppBootScript}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/js'.($sAppJsMin ? '/min' : '').'/boot'.$sAppJsMin.'.js');
|
||||
$aTemplateParameters['{{BaseAppMainCssLink}}'] = Utils::WebStaticPath('css/'.($bAdmin ? 'admin' : 'app').$sAppCssMin.'.css');
|
||||
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace('/\\s*([:;{},]+)\\s*/s', '$1', $oActions->compileCss($sThemeName, $bAdmin));
|
||||
$aTemplateParameters['{{BaseLanguage}}'] = $oActions->compileLanguage($sLanguage, $bAdmin);
|
||||
|
@ -204,6 +198,10 @@ abstract class Service
|
|||
}
|
||||
}
|
||||
|
||||
$SameSite = \strtolower($oConfig->Get('security', 'cookie_samesite', 'Strict'));
|
||||
$Secure = (isset($_SERVER['HTTPS']) || 'none' == $SameSite) ? ';secure' : '';
|
||||
$sResult = \str_replace('samesite=strict', "samesite={$SameSite}{$Secure}", $sResult);
|
||||
|
||||
$sScriptNonce = \SnappyMail\UUID::generate();
|
||||
static::setCSP($sScriptNonce);
|
||||
$sResult = \str_replace('nonce=""', 'nonce="'.$sScriptNonce.'"', $sResult);
|
||||
|
|
Loading…
Reference in a new issue