mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
Small cleanup
This commit is contained in:
parent
8b10abe5ac
commit
4cb88b408c
2 changed files with 3 additions and 4 deletions
|
@ -402,8 +402,7 @@ END;
|
|||
|
||||
public static function IsUtf8(string $sValue) : bool
|
||||
{
|
||||
return (bool) (\function_exists('mb_check_encoding') ?
|
||||
\mb_check_encoding($sValue, 'UTF-8') : \preg_match('//u', $sValue));
|
||||
return \mb_check_encoding($sValue, 'UTF-8');
|
||||
}
|
||||
|
||||
public static function FormatFileSize(int $iSize, int $iRound = 0) : string
|
||||
|
|
|
@ -216,10 +216,10 @@ class Service
|
|||
}
|
||||
// Internet Explorer does not support 'nonce'
|
||||
if (!\strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/') && !\strpos($_SERVER['HTTP_USER_AGENT'], 'Edge/1')) {
|
||||
// Knockout.js requires unsafe-inline?
|
||||
if ($sScriptNonce) {
|
||||
$sContentSecurityPolicy = \preg_replace("/(script-src[^;]+)'unsafe-inline'/", "\$1'nonce-{$sScriptNonce}'", $sContentSecurityPolicy);
|
||||
$sContentSecurityPolicy = \str_replace('script-src', "script-src 'nonce-{$sScriptNonce}'", $sContentSecurityPolicy);
|
||||
}
|
||||
// Knockout.js requires unsafe-inline?
|
||||
$sContentSecurityPolicy = \preg_replace("/(script-src[^;]+)'unsafe-inline'/", '$1', $sContentSecurityPolicy);
|
||||
// Knockout.js requires eval() for observable binding purposes
|
||||
//$sContentSecurityPolicy = \preg_replace("/(script-src[^;]+)'unsafe-eval'/", '$1', $sContentSecurityPolicy);
|
||||
|
|
Loading…
Reference in a new issue