日志升级与缓存修复最终版
This commit is contained in:
Regular → Executable
+13
-10
@@ -18,7 +18,7 @@ class CloakSession
|
||||
session_set_cookie_params([
|
||||
'lifetime' => 0,
|
||||
'path' => '/',
|
||||
'domain' => $domain,
|
||||
'domain' => ltrim($domain, '.'),
|
||||
'secure' => function_exists('cloak_request_is_https') && cloak_request_is_https(),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax',
|
||||
@@ -27,7 +27,7 @@ class CloakSession
|
||||
session_set_cookie_params(
|
||||
0,
|
||||
'/',
|
||||
$domain,
|
||||
ltrim($domain, '.'),
|
||||
function_exists('cloak_request_is_https') && cloak_request_is_https(),
|
||||
true
|
||||
);
|
||||
@@ -80,7 +80,13 @@ class CloakFcheckCors
|
||||
return false;
|
||||
}
|
||||
|
||||
$requestHost = (string) ($_SERVER['HTTP_HOST'] ?? '');
|
||||
$requestHost = function_exists('cloak_normalize_request_host')
|
||||
? cloak_normalize_request_host($_SERVER['HTTP_HOST'] ?? '')
|
||||
: strtolower(trim((string) ($_SERVER['HTTP_HOST'] ?? '')));
|
||||
$originHost = function_exists('cloak_normalize_request_host')
|
||||
? cloak_normalize_request_host($originHost)
|
||||
: strtolower(trim($originHost));
|
||||
|
||||
if ($requestHost !== '' && strcasecmp($originHost, $requestHost) === 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -103,18 +109,15 @@ class CloakFcheckCors
|
||||
*/
|
||||
private static function registrableSuffix($host)
|
||||
{
|
||||
if (function_exists('cloak_registrable_domain')) {
|
||||
return cloak_registrable_domain($host);
|
||||
}
|
||||
|
||||
$host = strtolower(trim($host));
|
||||
if ($host === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (function_exists('cloak_fingerprint_cookie_domain')) {
|
||||
$cookieDomain = ltrim(cloak_fingerprint_cookie_domain(), '.');
|
||||
if ($cookieDomain !== '' && self::hostMatchesSuffix($host, $cookieDomain)) {
|
||||
return $cookieDomain;
|
||||
}
|
||||
}
|
||||
|
||||
$parts = explode('.', $host);
|
||||
if (count($parts) < 2) {
|
||||
return $host;
|
||||
|
||||
Reference in New Issue
Block a user