From 4972ea34077e2c9b2af6c131b4826b79a4d0002b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 25 Aug 2009 18:36:44 +0000 Subject: [PATCH] Fix for r52174 - don't show footer for non-existing users --- includes/specials/SpecialContributions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 0646ccba82..4e9be9b9d2 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -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 != '-' ) { -- 2.20.1