Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/84002


Change subject: Minor bugfix to IP::prettifyIP.
......................................................................

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
---
M includes/IP.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/84002/1

diff --git a/includes/IP.php b/includes/IP.php
index 2051e69..fc76310 100644
--- a/includes/IP.php
+++ b/includes/IP.php
@@ -212,7 +212,7 @@
                                        $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

-- 
To view, visit https://gerrit.wikimedia.org/r/84002
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3631c34e02d9b830bf841bf960855626fbc88eb0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to