btongminh(a)svn.wikimedia.org schreef:
Revision: 39793
Author: btongminh
Date: 2008-08-21 22:15:34 +0000 (Thu, 21 Aug 2008)
Log Message:
-----------
* (bug 13879) Special:EmailUser shows a form in case no user was specified
Modified: trunk/phase3/includes/api/ApiEmailUser.php
===================================================================
--- trunk/phase3/includes/api/ApiEmailUser.php 2008-08-21 22:12:31 UTC (rev 39792)
+++ trunk/phase3/includes/api/ApiEmailUser.php 2008-08-21 22:15:34 UTC (rev 39793)
@@ -52,6 +52,8 @@
// Validate target
$targetUser = EmailUserForm::validateEmailTarget( $params['target'] );
+ if ( $targetUser === false )
+ $this->dieUsageMsg( array( 'notargettitle' ) );
if ( !( $targetUser instanceof User ) )
$this->dieUsageMsg( array( $targetUser[0] ) );
When you use dieUsageMsg() with a new message, please add that message
to ApiBase::$messageMap as well, or the client will get "Unknown error:
notargettitle", which isn't very pretty.
Roan Kattouw (Catrope)