(bug 35069) Keep history line from ending ' . . '
authorKevin Israel <pleasestand@live.com>
Sun, 8 Apr 2012 20:58:39 +0000 (16:58 -0400)
committerKevin Israel <pleasestand@live.com>
Sun, 8 Apr 2012 23:15:20 +0000 (19:15 -0400)
The portion of the history line after the character difference is now
added immediately before running PageHistoryLineEnding hooks, allowing
the omission of the ' . . ' separator if it would not actually separate
anything but rather remain at the line's end.

Patchset2: Added corresponding release note.

Change-Id: If6458bedb7492b15ece14f5eebbb697b93905a44

RELEASE-NOTES-1.20
includes/actions/HistoryAction.php

index 92e8367..12a0f92 100644 (file)
@@ -76,6 +76,8 @@ production.
 * (bug 35705) QUnit upgraded from 1.2.0 to 1.5.0
 * (bug 35749) Updated maintenance/checkSyntax.php to use Git instead of
   Subversion when invoked with the --modified option.
+* (bug 35069) On history pages, the " . . " separator after the number of
+  characters changed in a revision is now suppressed if no text would follow.
 
 === API changes in 1.20 ===
 * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
index dbc1ac0..c49d232 100644 (file)
@@ -611,12 +611,13 @@ class HistoryPager extends ReverseChronologicalPager {
                        : 0;
                $sDiff = ChangesList::showCharacterDifference( $prevSize, $rev->getSize() );
                $fSize = Linker::formatRevisionSize($rev->getSize());
-               $s .= " . . $fSize $sDiff . . ";
+               $s .= " . . $fSize $sDiff";
 
-               $s .= Linker::revComment( $rev, false, true );
+               # Text following the character difference is added just before running hooks
+               $s2 = Linker::revComment( $rev, false, true );
 
                if ( $notificationtimestamp && ( $row->rev_timestamp >= $notificationtimestamp ) ) {
-                       $s .= ' <span class="updatedmarker">' .  $this->msg( 'updatedmarker' )->escaped() . '</span>';
+                       $s2 .= ' <span class="updatedmarker">' .  $this->msg( 'updatedmarker' )->escaped() . '</span>';
                }
 
                $tools = array();
@@ -653,13 +654,20 @@ class HistoryPager extends ReverseChronologicalPager {
                }
 
                if ( $tools ) {
-                       $s .= ' '. $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
+                       $s2 .= ' '. $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
                }
 
                # Tags
                list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow( $row->ts_tags, 'history' );
                $classes = array_merge( $classes, $newClasses );
-               $s .= " $tagSummary";
+               if ( $tagSummary !== '' ) {
+                       $s2 .= " $tagSummary";
+               }
+
+               # Include separator between character difference and following text
+               if ( $s2 !== '' ) {
+                       $s .= " . . $s2";
+               }
 
                wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s, &$classes ) );