mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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
|
public static function IsUtf8(string $sValue) : bool
|
||||||
{
|
{
|
||||||
return (bool) (\function_exists('mb_check_encoding') ?
|
return \mb_check_encoding($sValue, 'UTF-8');
|
||||||
\mb_check_encoding($sValue, 'UTF-8') : \preg_match('//u', $sValue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function FormatFileSize(int $iSize, int $iRound = 0) : string
|
public static function FormatFileSize(int $iSize, int $iRound = 0) : string
|
||||||
|
|
|
||||||
|
|
@ -216,10 +216,10 @@ class Service
|
||||||
}
|
}
|
||||||
// Internet Explorer does not support 'nonce'
|
// Internet Explorer does not support 'nonce'
|
||||||
if (!\strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/') && !\strpos($_SERVER['HTTP_USER_AGENT'], 'Edge/1')) {
|
if (!\strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/') && !\strpos($_SERVER['HTTP_USER_AGENT'], 'Edge/1')) {
|
||||||
// Knockout.js requires unsafe-inline?
|
|
||||||
if ($sScriptNonce) {
|
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);
|
$sContentSecurityPolicy = \preg_replace("/(script-src[^;]+)'unsafe-inline'/", '$1', $sContentSecurityPolicy);
|
||||||
// Knockout.js requires eval() for observable binding purposes
|
// Knockout.js requires eval() for observable binding purposes
|
||||||
//$sContentSecurityPolicy = \preg_replace("/(script-src[^;]+)'unsafe-eval'/", '$1', $sContentSecurityPolicy);
|
//$sContentSecurityPolicy = \preg_replace("/(script-src[^;]+)'unsafe-eval'/", '$1', $sContentSecurityPolicy);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue