r86709 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86708‎ | r86709 | r86710 >
Date:14:25, 22 April 2011
Author:mah
Status:resolved (Comments)
Tags:
Comment:
Updated patch from Bergi re: r86676 with tested code to fix bug #28642
Modified paths:
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_Hash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Preprocessor_Hash.php
@@ -304,13 +304,11 @@
305305
306306 if ( $stack->top ) {
307307 $part = $stack->top->getCurrentPart();
308 - if ( isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 ) {
309 - // Comments abutting, no change in visual end
310 - $part->commentEnd = $wsEnd;
311 - } else {
 308+ if ( ! (isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
312309 $part->visualEnd = $wsStart;
313 - $part->commentEnd = $endPos;
314310 }
 311+ // Else comments abutting, no change in visual end
 312+ $part->commentEnd = $endPos;
315313 }
316314 $i = $endPos + 1;
317315 $inner = substr( $text, $startPos, $endPos - $startPos + 1 );
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -343,11 +343,11 @@
344344
345345 if ( $stack->top ) {
346346 $part = $stack->top->getCurrentPart();
347 - $part->commentEnd = $endPos;
348347 if ( ! (isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
349348 $part->visualEnd = $wsStart;
350349 }
351350 // Else comments abutting, no change in visual end
 351+ $part->commentEnd = $endPos;
352352 }
353353 $i = $endPos + 1;
354354 $inner = substr( $text, $startPos, $endPos - $startPos + 1 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r86795* Add preprocessor tests that Bergi supplied for Bug #28642...mah21:26, 23 April 2011
r87228Apply r86676+r86709 changes to the native preprocessor.platonides22:28, 1 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86676Fix bug #28642 - wrong part->commentEnd set to abbutting comments...mah22:20, 21 April 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   18:13, 21 June 2011

Ok with addition of test cases in r86795.

Status & tagging log