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
$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