From 9c349d317661b28f073073437d8934d3e19b49b2 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Sun, 8 Apr 2012 16:58:39 -0400 Subject: [PATCH] (bug 35069) Keep history line from ending ' . . ' 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 | 2 ++ includes/actions/HistoryAction.php | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 92e836755d..12a0f929d4 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -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. diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index dbc1ac07b8..c49d23299e 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -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 .= ' ' . $this->msg( 'updatedmarker' )->escaped() . ''; + $s2 .= ' ' . $this->msg( 'updatedmarker' )->escaped() . ''; } $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 ) ); -- 2.20.1