From 3bddedf685051638fdba61268ad195fee041db1c Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 2 Feb 2011 07:54:46 +0100 Subject: update to MediaWiki 1.16.2 --- includes/StringUtils.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'includes/StringUtils.php') diff --git a/includes/StringUtils.php b/includes/StringUtils.php index c437b3c1..0be88df5 100644 --- a/includes/StringUtils.php +++ b/includes/StringUtils.php @@ -77,16 +77,20 @@ class StringUtils { } if ( $tokenType == 'start' ) { - $inputPos = $tokenOffset + $tokenLength; # Only move the start position if we haven't already found a start # This means that START START END matches outer pair if ( !$foundStart ) { # Found start + $inputPos = $tokenOffset + $tokenLength; # Write out the non-matching section $output .= substr( $subject, $outputPos, $tokenOffset - $outputPos ); $outputPos = $tokenOffset; $contentPos = $inputPos; $foundStart = true; + } else { + # Move the input position past the *first character* of START, + # to protect against missing END when it overlaps with START + $inputPos = $tokenOffset + 1; } } elseif ( $tokenType == 'end' ) { if ( $foundStart ) { -- cgit v1.2.3-54-g00ecf