diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-02-02 07:54:46 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-02-02 07:54:46 +0100 |
commit | 3bddedf685051638fdba61268ad195fee041db1c (patch) | |
tree | 93ed42491453fef8fe0614d2620146b8b603db1d /includes/StringUtils.php | |
parent | 8f93926e1bc6e96fc11b4d0d201025022d471de7 (diff) |
update to MediaWiki 1.16.2
Diffstat (limited to 'includes/StringUtils.php')
-rw-r--r-- | includes/StringUtils.php | 6 |
1 files changed, 5 insertions, 1 deletions
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 ) { |