aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-05-13 16:15:20 +0000
committerNils Adermann <naderman@naderman.de>2007-05-13 16:15:20 +0000
commit4b876ffee5b714bcd7fbf8eb2df022f32251a9ff (patch)
tree77a8557507f9fd919486683e2566db34a64fc2f2 /phpBB/includes/session.php
parentb8daa787095eece45eeb3e1b6351efbed292bbd1 (diff)
downloadforums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar.gz
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar.bz2
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar.xz
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.zip
- correctly transfer the search query across search result pages
- changed highlighting so foo* will match foo again [Bug #10031] - restructured magic urls (functionality still mostly the same), added a check for entities in urls and punctuation at the end of magic urls [Bugs #10639, #10293] - undid the workaround for urls in quotes, as it's fixed by the new magic url handling - allow magic urls enclosed in BBCode [Bug #10319] - added handling for IPv6 addresses to the IP checking without adding extra options [Bug #9538] - correctly handle search in search results of search queries with brackets [Bug #10581] - added information about requirements for auth_apache [Bug #10107] git-svn-id: file:///svn/phpbb/trunk@7559 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php26
1 files changed, 21 insertions, 5 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 85ad21cabc..31ad37bc8d 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -229,9 +229,17 @@ class session
// Validate IP length according to admin ... enforces an IP
// check on bots if admin requires this
// $quadcheck = ($config['ip_check_bot'] && $this->data['user_type'] & USER_BOT) ? 4 : $config['ip_check'];
-
- $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
- $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
+
+ if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false)
+ {
+ $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']);
+ $u_ip = short_ipv6($this->ip, $config['ip_check']);
+ }
+ else
+ {
+ $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
+ $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
+ }
$s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : '';
$u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : '';
@@ -489,8 +497,16 @@ class session
if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id'])
{
// Only assign the current session if the ip, browser and forwarded_for match...
- $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
- $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
+ if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false)
+ {
+ $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']);
+ $u_ip = short_ipv6($this->ip, $config['ip_check']);
+ }
+ else
+ {
+ $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
+ $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
+ }
$s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : '';
$u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : '';