aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php10
1 files changed, 7 insertions, 3 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;
}