Index: trunk/phase3/includes/api/ApiEmailUser.php |
— | — | @@ -52,8 +52,6 @@ |
53 | 53 | |
54 | 54 | // Validate target |
55 | 55 | $targetUser = EmailUserForm::validateEmailTarget( $params['target'] ); |
56 | | - if ( $targetUser === false ) |
57 | | - $this->dieUsageMsg( array( 'notargettitle' ) ); |
58 | 56 | if ( !( $targetUser instanceof User ) ) |
59 | 57 | $this->dieUsageMsg( array( $targetUser[0] ) ); |
60 | 58 | |
Index: trunk/phase3/includes/specials/SpecialEmailuser.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); |
16 | 16 | $targetUser = EmailUserForm::validateEmailTarget( $target ); |
17 | 17 | |
18 | | - if ( !( $targetUser instanceof User ) && $targetUser !== false ) { |
| 18 | + if ( !( $targetUser instanceof User ) ) { |
19 | 19 | $wgOut->showErrorPage( $targetUser[0], $targetUser[1] ); |
20 | 20 | return; |
21 | 21 | } |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | | - if ( "submit" == $action && $wgRequest->wasPosted() && $targetUser !== false ) { |
| 51 | + if ( "submit" == $action && $wgRequest->wasPosted() ) { |
52 | 52 | $result = $form->doSubmit(); |
53 | 53 | |
54 | 54 | if ( !is_null( $result ) ) { |
— | — | @@ -98,9 +98,8 @@ |
99 | 99 | $senderLink = $skin->makeLinkObj( |
100 | 100 | $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ); |
101 | 101 | $emt = wfMsg( "emailto" ); |
102 | | - $recipient = $this->target instanceof User ? |
103 | | - htmlspecialchars( $this->target->getName() ) : |
104 | | - ''; |
| 102 | + $recipientLink = $skin->makeLinkObj( |
| 103 | + $this->target->getUserPage(), htmlspecialchars( $this->target->getName() ) ); |
105 | 104 | $emr = wfMsg( "emailsubject" ); |
106 | 105 | $emm = wfMsg( "emailmessage" ); |
107 | 106 | $ems = wfMsg( "emailsend" ); |
— | — | @@ -108,7 +107,8 @@ |
109 | 108 | $encSubject = htmlspecialchars( $this->subject ); |
110 | 109 | |
111 | 110 | $titleObj = SpecialPage::getTitleFor( "Emailuser" ); |
112 | | - $action = $titleObj->escapeLocalURL( "action=submit" ); |
| 111 | + $action = $titleObj->escapeLocalURL( "target=" . |
| 112 | + urlencode( $this->target->getName() ) . "&action=submit" ); |
113 | 113 | $token = htmlspecialchars( $wgUser->editToken() ); |
114 | 114 | |
115 | 115 | $wgOut->addHTML( " |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | <td align='left'><strong>{$senderLink}</strong></td> |
120 | 120 | </tr><tr> |
121 | 121 | <td align='right'>{$emt}:</td> |
122 | | -<td align='left'><input type='text' size='60' name='target' value='{$recipient}' /></td> |
| 122 | +<td align='left'><strong>{$recipientLink}</strong></td> |
123 | 123 | </tr><tr> |
124 | 124 | <td align='right'>{$emr}:</td> |
125 | 125 | <td align='left'> |
— | — | @@ -235,7 +235,8 @@ |
236 | 236 | return array( "nosuchspecialpage", "nospecialpagetext" ); |
237 | 237 | |
238 | 238 | if ( "" == $target ) { |
239 | | - return false; |
| 239 | + wfDebug( "Target is empty.\n" ); |
| 240 | + return array( "notargettitle", "notargettext" ); |
240 | 241 | } |
241 | 242 | |
242 | 243 | $nt = Title::newFromURL( $target ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -94,7 +94,6 @@ |
95 | 95 | * HTML entities like now work (are not escaped) in edit summaries. |
96 | 96 | * (bug 13815) In the comment for page moves, use the colon-separator message |
97 | 97 | instead of a hardcoded colon. |
98 | | -* (bug 13879) Special:EmailUser shows a form in case no user was specified |
99 | 98 | |
100 | 99 | === Bug fixes in 1.14 === |
101 | 100 | |