mirror of
https://github.com/tursom/typecho-plugin-Access.git
synced 2025-03-15 03:40:31 +08:00
修改入口检测函数的判断方式 之前的方式会出现同一个用户通过不同入口进入会一直得到第一次进入的入口而不是新入口(由于被保存在了cookie里)
This commit is contained in:
parent
68a0e34491
commit
4b39e810f0
@ -246,15 +246,15 @@ class Access_Core
|
||||
*/
|
||||
public function getEntryPoint()
|
||||
{
|
||||
$entrypoint = Typecho_Cookie::get('__typecho_access_entrypoint');
|
||||
$entrypoint = $this->request->getReferer();
|
||||
if ($entrypoint == null) {
|
||||
$entrypoint = $this->request->getReferer();
|
||||
if (parse_url($entrypoint, PHP_URL_HOST) == parse_url(Helper::options()->siteUrl, PHP_URL_HOST)) {
|
||||
$entrypoint = null;
|
||||
}
|
||||
if ($entrypoint != null) {
|
||||
Typecho_Cookie::set('__typecho_access_entrypoint', $entrypoint);
|
||||
}
|
||||
$entrypoint = Typecho_Cookie::get('__typecho_access_entrypoint');
|
||||
}
|
||||
if (parse_url($entrypoint, PHP_URL_HOST) == parse_url(Helper::options()->siteUrl, PHP_URL_HOST)) {
|
||||
$entrypoint = null;
|
||||
}
|
||||
if ($entrypoint != null) {
|
||||
Typecho_Cookie::set('__typecho_access_entrypoint', $entrypoint);
|
||||
}
|
||||
return $entrypoint;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user