From d0e8bde0a911facfde410d5a13ef7c29c1fb9a4c Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Thu, 12 Sep 2013 08:17:42 -0700 Subject: [PATCH] Minor bugfix to IP::prettifyIP. The offset returned by preg_match with the PREG_OFFSET_CAPTURE is an absolute position in the string. You shouldn't *add* it to the current position in order to advance past the match. Change-Id: I3631c34e02d9b830bf841bf960855626fbc88eb0 --- includes/IP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/IP.php b/includes/IP.php index 2051e693b2..fc76310aa8 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -212,7 +212,7 @@ class IP { $longest = $match; $longestPos = $pos; } - $offset += ( $pos + strlen( $match ) ); // advance + $offset = ( $pos + strlen( $match ) ); // advance } if ( $longest !== false ) { // Replace this portion of the string with the '::' abbreviation -- 2.20.1