r55578 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55577‎ | r55578 | r55579 >
Date:18:36, 25 August 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Fix for r52174 - don't show footer for non-existing users
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -111,8 +111,16 @@
112112
113113 # Show the appropriate "footer" message - WHOIS tools, etc.
114114 if( $target != 'newbies' ) {
115 - $message = IP::isIPAddress( $target ) ?
116 - 'sp-contributions-footer-anon' : 'sp-contributions-footer';
 115+ $message = 'sp-contributions-footer';
 116+ if ( IP::isIPAddress( $target ) ) {
 117+ $message = 'sp-contributions-footer-anon';
 118+ } else {
 119+ $user = User::newFromName( $target );
 120+ if ( !$user || $user->isAnon() ) {
 121+ // No message for non-existing users
 122+ return;
 123+ }
 124+ }
117125
118126 $text = wfMsgNoTrans( $message, $target );
119127 if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52174* (bug 19294) Always show Sp-contributions-footer(-anon)nikerabbit19:29, 19 June 2009

Status & tagging log