r44914 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44913‎ | r44914 | r44915 >
Date:20:38, 22 December 2008
Author:raymond
Status:ok
Tags:
Comment:
* Fix double escaping
* Use more XML functions
Modified paths:
  • /trunk/extensions/Oversight/HideRevision_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Oversight/HideRevision_body.php
@@ -68,11 +68,11 @@
6969 'method' => 'post' ) ) .
7070
7171 // Visible fields
72 - Xml::inputLabel( wfMsgHTML( 'hiderevision-prompt' ), 'revision[]', 'wpRevision', 10 ) .
 72+ Xml::inputLabel( wfMsg( 'hiderevision-prompt' ), 'revision[]', 'wpRevision', 10 ) .
7373 "<br />" .
74 - Xml::inputLabel( wfMsgHTML( 'hiderevision-reason' ), 'wpReason', 'wpReason', 60 ) .
 74+ Xml::inputLabel( wfMsg( 'hiderevision-reason' ), 'wpReason', 'wpReason', 60 ) .
7575 "<br />" .
76 - Xml::submitButton( wfMsgHTML( 'hiderevision-continue' ), array( 'id' => 'mw-hiderevision-continue' ) ) .
 76+ Xml::submitButton( wfMsg( 'hiderevision-continue' ), array( 'id' => 'mw-hiderevision-continue' ) ) .
7777
7878 Xml::closeElement( 'form' ) );
7979 }
@@ -97,9 +97,9 @@
9898
9999 // Visible fields
100100 "<br />" .
101 - Xml::inputLabel( wfMsgHTML( 'hiderevision-reason' ), 'wpReason', 'wpReason', 60, $this->mReason ) .
 101+ Xml::inputLabel( wfMsg( 'hiderevision-reason' ), 'wpReason', 'wpReason', 60, $this->mReason ) .
102102 "<br />" .
103 - Xml::submitButton( wfMsgHTML( 'hiderevision-submit' ), array( 'id' => 'mw-hiderevision-submit' ) ) .
 103+ Xml::submitButton( wfMsg( 'hiderevision-submit' ), array( 'id' => 'mw-hiderevision-submit' ) ) .
104104
105105 // Hidden fields
106106 $this->revisionFields() .
@@ -391,19 +391,19 @@
392392 $title = Title::newFromUrl( $page );
393393 $u = User::newFromName( $user );
394394 $page = $title ? $page : ''; // blank invalid titles
395 -
396 - $action = htmlspecialchars( $wgScript );
397 - $wgOut->addHTML( "<form action=\"$action\" method=\"get\"><fieldset>" );
398 - $wgOut->addHTML( '<legend>' . wfMsgHtml('oversight-legend') . '</legend>' );
399 - $wgOut->addHTML( Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) );
400 - $wgOut->addHTML( Xml::inputLabel( wfMsg( 'oversight-oversighter' ), 'user', 'mw-oversight-user', 20, $user ) );
401 - $wgOut->addHTML( '&nbsp;' );
402 - $wgOut->addHTML( Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'mw-oversight-page', 25, $page ) );
403 - $wgOut->addHTML( '&nbsp;' );
404 - $wgOut->addHTML( Xml::inputLabel( wfMsg( 'oversight-offender' ), 'author', 'mw-oversight-author', 20, $offender ) );
405 - $wgOut->addHTML( '&nbsp;' . Xml::submitButton( wfMsg( 'allpagessubmit' ), array( 'id' => 'mw-oversight-submit' ) ) );
406 - $wgOut->addHTML( '</fieldset></form>' );
407 -
 395+
 396+ $wgOut->addHTML(
 397+ Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get', 'id' => 'mw-hiderevision-form' ) ) .
 398+ Xml::fieldset( wfMsg( 'oversight-legend' ) ) .
 399+ Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) .
 400+ Xml::inputLabel( wfMsg( 'oversight-oversighter' ), 'user', 'mw-oversight-user', 20, $user ) . ' ' .
 401+ Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'mw-oversight-page', 25, $page ) . ' ' .
 402+ Xml::inputLabel( wfMsg( 'oversight-offender' ), 'author', 'mw-oversight-author', 20, $offender ) . ' ' .
 403+ Xml::submitButton( wfMsg( 'allpagessubmit' ), array( 'id' => 'mw-oversight-submit' ) ) .
 404+ Xml::closeElement( 'fieldset' ) .
 405+ Xml::closeElement( 'form' )
 406+ );
 407+
408408 $pager = new HiddenRevisionsPager( $this, array(), $title, $u, $offender );
409409 if( $pager->getNumRows() ) {
410410 $wgOut->addHTML( wfMsgExt('oversight-header', array('parse') ) );

Status & tagging log