From: Niklas Laxström Date: Tue, 25 Aug 2009 18:36:44 +0000 (+0000) Subject: Fix for r52174 - don't show footer for non-existing users X-Git-Tag: 1.31.0-rc.0~40062 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=4972ea34077e2c9b2af6c131b4826b79a4d0002b;p=lhc%2Fweb%2Fwiklou.git Fix for r52174 - don't show footer for non-existing users --- 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 != '-' ) {