修复referer为空时主页报错

Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /usr/plugins/Access/Access_Core.php on line 347

Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /usr/plugins/Access/Access_Core.php on line 400

Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /usr/plugins/Access/Access_Core.php on line 402
This commit is contained in:
BapiGso 2022-04-06 09:41:30 +08:00 committed by GitHub
parent 365a60b30a
commit e719b09b51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,7 +342,7 @@ class Access_Core
{
$entrypoint = $this->request->getReferer();
if ($entrypoint == null) {
$entrypoint = Typecho_Cookie::get('__typecho_access_entrypoint');
$entrypoint = Typecho_Cookie::get('__typecho_access_entrypoint')?:'';
}
if (parse_url($entrypoint, PHP_URL_HOST) == parse_url(Helper::options()->siteUrl, PHP_URL_HOST)) {
$entrypoint = '';
@ -375,6 +375,9 @@ class Access_Core
$entrypoint = $this->getEntryPoint();
$referer = $this->request->getReferer();
if (empty($referer)){
$referer = '';
}
$time = Helper::options()->gmtTime + (Helper::options()->timezone - Helper::options()->serverTimezone);
if ($archive != null) {