Fix for r52174 - don't show footer for non-existing users
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 25 Aug 2009 18:36:44 +0000 (18:36 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 25 Aug 2009 18:36:44 +0000 (18:36 +0000)
includes/specials/SpecialContributions.php

index 0646ccb..4e9be9b 100644 (file)
@@ -111,8 +111,16 @@ class SpecialContributions extends SpecialPage {
 
                # Show the appropriate "footer" message - WHOIS tools, etc.
                if( $target != 'newbies' ) {
-                       $message = IP::isIPAddress( $target ) ?
-                               'sp-contributions-footer-anon' : 'sp-contributions-footer';
+                       $message = 'sp-contributions-footer';
+                       if ( IP::isIPAddress( $target ) ) {
+                               $message = 'sp-contributions-footer-anon';
+                       } else {
+                               $user = User::newFromName( $target );
+                               if ( !$user || $user->isAnon() ) {
+                                       // No message for non-existing users
+                                       return;
+                               }
+                       }
 
                        $text = wfMsgNoTrans( $message, $target );
                        if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {