r94130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94129‎ | r94130 | r94131 >
Date:18:30, 9 August 2011
Author:aaron
Status:ok
Tags:
Comment:
Follow-up r92065: call userForm dynamically. Also made userForm protected as no one else calls it and it's not static anymore.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -117,7 +117,7 @@
118118 $ret = ( $ret == 'notarget' ) ? 'emailnotarget' : ( $ret . 'text' );
119119 $out->addHTML( '<p class="error">' . wfMessage( $ret )->parse() . '</p>' );
120120 }
121 - $out->addHTML( self::userForm( $this->mTarget ) );
 121+ $out->addHTML( $this->userForm( $this->mTarget ) );
122122 return false;
123123 }
124124
@@ -219,17 +219,16 @@
220220 * @param $name String: user name submitted.
221221 * @return String: form asking for user name.
222222 */
223 -
224 - function userForm( $name ) {
225 - global $wgScript ;
 223+ protected function userForm( $name ) {
 224+ global $wgScript;
226225 $string = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'askusername' ) ) .
227 - Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
228 - Xml::openElement( 'fieldset' ) .
229 - Html::rawElement( 'legend', null, wfMessage( 'emailtarget' )->parse() ) .
230 - Xml::inputLabel( wfMessage( 'emailusername' )->text(), 'target', 'emailusertarget', 30, $name ) . ' ' .
231 - Xml::submitButton( wfMessage( 'emailusernamesubmit' )->text() ) .
232 - Xml::closeElement( 'fieldset' ) .
233 - Xml::closeElement( 'form' ) . "\n";
 226+ Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
 227+ Xml::openElement( 'fieldset' ) .
 228+ Html::rawElement( 'legend', null, wfMessage( 'emailtarget' )->parse() ) .
 229+ Xml::inputLabel( wfMessage( 'emailusername' )->text(), 'target', 'emailusertarget', 30, $name ) . ' ' .
 230+ Xml::submitButton( wfMessage( 'emailusernamesubmit' )->text() ) .
 231+ Xml::closeElement( 'fieldset' ) .
 232+ Xml::closeElement( 'form' ) . "\n";
234233 return $string;
235234 }
236235

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92065Fix for r85876 by doing away with a potentially invalid user name parameter b...purodha15:57, 13 July 2011

Status & tagging log