aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-05-13 20:09:33 +0000
committerNils Adermann <naderman@naderman.de>2007-05-13 20:09:33 +0000
commit36cb62292fde86ab15875e5c2d54d024eb6fd878 (patch)
tree8fd927aeecc98c212f3fc67a5b9ab4b7468f9e4c
parentf1b60939fd5ac8be9f0c9db4a65eca94d1222340 (diff)
downloadforums-36cb62292fde86ab15875e5c2d54d024eb6fd878.tar
forums-36cb62292fde86ab15875e5c2d54d024eb6fd878.tar.gz
forums-36cb62292fde86ab15875e5c2d54d024eb6fd878.tar.bz2
forums-36cb62292fde86ab15875e5c2d54d024eb6fd878.tar.xz
forums-36cb62292fde86ab15875e5c2d54d024eb6fd878.zip
- use /48 and /64 subnets for IPv6 matching [Bug #9538]
git-svn-id: file:///svn/phpbb/trunk@7561 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/functions.php10
-rw-r--r--phpBB/language/en/acp/board.php2
2 files changed, 8 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 079d09ac94..5cbb3b4515 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3411,9 +3411,10 @@ function get_preg_expression($mode)
}
/**
-* Returns the first 4 blocks of the specified IPv6 address and as many
-* as specified in the length paramater additional ones.
+* Returns the first block of the specified IPv6 address and as many additional
+* ones as specified in the length paramater.
* If length is zero, then an empty string is returned.
+* If length is greater than 3 the complete IP will be returned
*/
function short_ipv6($ip, $length)
{
@@ -3432,7 +3433,10 @@ function short_ipv6($ip, $length)
{
$ip = '0000' . $ip;
}
- $ip = implode(':', array_slice(explode(':', $ip), 0, 4 + $length));
+ if ($length < 4)
+ {
+ $ip = implode(':', array_slice(explode(':', $ip), 0, 1 + $length));
+ }
return $ip;
}
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 9c8d1e9726..441cd9a164 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -357,7 +357,7 @@ $lang = array_merge($lang, array(
'FORWARDED_FOR_VALID' => 'Validated <var>X_FORWARDED_FOR</var> header',
'FORWARDED_FOR_VALID_EXPLAIN' => 'Sessions will only be continued if the sent <var>X_FORWARDED_FOR</var> header equals the one sent with the previous request. Bans will be checked against IPs in <var>X_FORWARDED_FOR</var> too.',
'IP_VALID' => 'Session IP validation',
- 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; <samp>All</samp> compares the complete address, <samp>A.B.C</samp> the first x.x.x, <samp>A.B</samp> the first x.x, <samp>None</samp> disables checking. On IPv6 addresses <samp>A.B.C</samp> compares the first 7 blocks and <samp>A.B</samp> the first 6 blocks.',
+ 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; <samp>All</samp> compares the complete address, <samp>A.B.C</samp> the first x.x.x, <samp>A.B</samp> the first x.x, <samp>None</samp> disables checking. On IPv6 addresses <samp>A.B.C</samp> compares the first 4 blocks and <samp>A.B</samp> the first 3 blocks.',
'MAX_LOGIN_ATTEMPTS' => 'Maximum number of login attempts',
'MAX_LOGIN_ATTEMPTS_EXPLAIN' => 'After this number of failed logins the user needs to additionally confirm his login visually (visual confirmation).',
'NO_IP_VALIDATION' => 'None',