r45351 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45350‎ | r45351 | r45352 >
Date:22:14, 2 January 2009
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
(bug 16044) Vague error message in Special:Emailuser
Modified paths:
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -268,9 +268,15 @@
269269 }
270270
271271 $nu = User::newFromName( $nt->getText() );
272 - if( is_null( $nu ) || !$nu->canReceiveEmail() ) {
273 - wfDebug( "Target is invalid user or can't receive.\n" );
 272+ if( is_null( $nu ) ) {
 273+ wfDebug( "Target is invalid user.\n" );
 274+ return "notarget";
 275+ } else if ( !$nu->isEmailConfirmed() ) {
 276+ wfDebug( "User has no valid email.\n" );
274277 return "noemail";
 278+ } else if ( !$nu->canReceiveEmail() ) {
 279+ wfDebug( "User does not allow user emails.\n" );
 280+ return "nowikiemail";
275281 }
276282
277283 return $nu;

Follow-up revisions

RevisionCommit summaryAuthorDate
r45352Follow up to r45351: forgot to add messagesaaron22:16, 2 January 2009
r45474Fix regression in r45351 "(bug 16044) Vague error message in Special:Emailuser"...brion01:19, 7 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   01:19, 7 January 2009

Fixed a regression in r45474

Non-existent users and anon addresses were showing "noemail" instead of "notarget" message, since only the invalid name case was now being checked.

Status & tagging log