followup to -r112918 - display old title in SpecialNews page when namespace or title...
authorBenny Situ <bsitu@users.mediawiki.org>
Wed, 7 Mar 2012 21:45:38 +0000 (21:45 +0000)
committerBenny Situ <bsitu@users.mediawiki.org>
Wed, 7 Mar 2012 21:45:38 +0000 (21:45 +0000)
includes/specials/SpecialNewpages.php

index 54bcb97..6256b08 100644 (file)
@@ -356,11 +356,11 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                $css = count( $classes ) ? ' class="' . implode( ' ', $classes ) . '"' : '';
 
-               # Display the old title if the namespace has been changed
+               # Display the old title if the namespace/title has been changed
                $oldTitleText = '';
-               if ( $result->page_namespace !== $result->rc_namespace ) {
-                       $oldTitleText = wfMessage( 'rc-old-title' )->params( Title::makeTitle( $result->rc_namespace, $result->rc_title )
-                                                                  ->getPrefixedText() )->escaped();    
+               $oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
+               if ( !$title->equals( $oldTitle ) ) {
+                       $oldTitleText = wfMessage( 'rc-old-title' )->params( $oldTitle->getPrefixedText() )->escaped(); 
                }
 
                return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n";