From: C. Scott Ananian Date: Thu, 12 Sep 2013 15:17:42 +0000 (-0700) Subject: Minor bugfix to IP::prettifyIP. X-Git-Tag: 1.31.0-rc.0~18758^2 X-Git-Url: http://git.cyclocoop.org//%27http:/ie7-js.googlecode.com/svn/test/index.html/%27?a=commitdiff_plain;h=d0e8bde0a911facfde410d5a13ef7c29c1fb9a4c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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