mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 12:58:52 +00:00
ok, i do not why the db is setting the type for user id to string - but with this change bots should no longer "spawn" sessions. ;)
git-svn-id: file:///svn/phpbb/trunk@6475 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
23a6cf3efb
commit
e168cd2793
1 changed files with 4 additions and 1 deletions
|
@ -430,6 +430,9 @@ class session
|
||||||
$this->data['session_last_visit'] = $this->time_now;
|
$this->data['session_last_visit'] = $this->time_now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force user id to be integer...
|
||||||
|
$this->data['user_id'] = (int) $this->data['user_id'];
|
||||||
|
|
||||||
// At this stage we should have a filled data array, defined cookie u and k data.
|
// At this stage we should have a filled data array, defined cookie u and k data.
|
||||||
// data array should contain recent session info if we're a real user and a recent
|
// data array should contain recent session info if we're a real user and a recent
|
||||||
// session exists in which case session_id will also be set
|
// session exists in which case session_id will also be set
|
||||||
|
@ -445,7 +448,7 @@ class session
|
||||||
$this->data['is_bot'] = ($bot) ? true : false;
|
$this->data['is_bot'] = ($bot) ? true : false;
|
||||||
|
|
||||||
// If our friend is a bot, we re-assign a previously assigned session
|
// If our friend is a bot, we re-assign a previously assigned session
|
||||||
if ($this->data['is_bot'] && $bot === $this->data['user_id'] && $this->data['session_id'])
|
if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id'])
|
||||||
{
|
{
|
||||||
// Only assign the current session if the ip and browser match...
|
// Only assign the current session if the ip and browser match...
|
||||||
$s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
|
$s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
|
||||||
|
|
Loading…
Add table
Reference in a new issue