From 8f4335bb482377923d27c2f7d45737bbc81e0889 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 8 Nov 2008 20:36:21 +0000 Subject: [PATCH] (bug 8345) Don't autosummarize where a redirect was left unchanged --- RELEASE-NOTES | 1 + includes/Article.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ba64820d3d..0ed6095aeb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -325,6 +325,7 @@ The following extensions are migrated into MediaWiki 1.14: revision when passing oldid parameter in the url * (bug 16265) When caching thumbs with the ForeignApiRepo, we now use the same filename as the remote site. +* (bug 8345) Don't autosummarize where a redirect was left unchanged === API changes in 1.14 === diff --git a/includes/Article.php b/includes/Article.php index 60d98cf2cf..23435ce92b 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -3432,8 +3432,9 @@ class Article { # Decide what kind of autosummary is needed. # Redirect autosummaries + $ot = Title::newFromRedirect( $oldtext ); $rt = Title::newFromRedirect( $newtext ); - if( is_object( $rt ) ) { + if( is_object( $rt ) && ( !is_object( $ot ) || ( !$rt->equals( $ot ) || $ot->getFragment() != $rt->getFragment() ) ) ) { return wfMsgForContent( 'autoredircomment', $rt->getFullText() ); } @@ -3443,14 +3444,14 @@ class Article { global $wgContLang; $truncatedtext = $wgContLang->truncate( str_replace("\n", ' ', $newtext), - max( 0, 200 - strlen( wfMsgForContent( 'autosumm-new') ) ), + max( 0, 200 - strlen( wfMsgForContent( 'autosumm-new' ) ) ), '...' ); return wfMsgForContent( 'autosumm-new', $truncatedtext ); } # Blanking autosummaries if( $oldtext != '' && $newtext == '' ) { - return wfMsgForContent('autosumm-blank'); + return wfMsgForContent( 'autosumm-blank' ); } elseif( strlen( $oldtext ) > 10 * strlen( $newtext ) && strlen( $newtext ) < 500) { # Removing more than 90% of the article global $wgContLang; -- 2.20.1