r26156 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26155‎ | r26156 | r26157 >
Date:15:03, 26 September 2007
Author:brion
Status:old
Tags:
Comment:
Fixups:
* Don't abuse $enc variable prefix for variables that aren't encoded for output
* Don't put $wgScript raw into HTML output
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -536,14 +536,15 @@
537537 function showForm( $wgRequest ) {
538538 global $wgOut, $wgTitle, $wgScript;
539539
540 - $encPage = str_replace( '_', ' ', $this->target );
 540+ $pageName = str_replace( '_', ' ', $this->target );
541541
542 - $form = "<form name='stableversions' action='$wgScript' method='get'>";
 542+ $form = Xml::openElement( 'form',
 543+ array( 'name' => 'stableversions', 'action' => $wgScript, 'method' => 'get' ) );
543544 $form .= "<fieldset><legend>".wfMsg('stableversions-leg1')."</legend>";
544545 $form .= "<table><tr>";
545546 $form .= "<td>".Xml::hidden( 'title', $wgTitle->getPrefixedText() )."</td>";
546547 $form .= "<td>".wfMsgHtml("stableversions-page")."</td>";
547 - $form .= "<td>".Xml::input('page', 40, $encPage, array( 'id' => 'page' ) )."</td>";
 548+ $form .= "<td>".Xml::input('page', 40, $pageName, array( 'id' => 'page' ) )."</td>";
548549 $form .= "<td>".wfSubmitButton( wfMsgHtml( 'go' ) )."</td>";
549550 $form .= "</tr></table>";
550551 $form .= "</fieldset></form>\n";
@@ -900,13 +901,13 @@
901902 function showForm( $wgRequest ) {
902903 global $wgOut, $wgTitle, $wgScript;
903904
904 - $encPage = str_replace( '_', ' ', $this->target );
905 - $form = "<form name='stabilization' action='$wgScript' method='get'>";
 905+ $pageName = str_replace( '_', ' ', $this->target );
 906+ $form = Xml::openElement( 'form', array( 'name' => 'stablization', 'action' => $wgScript, 'method' => 'get' ) );
906907 $form .= "<fieldset><legend>".wfMsg('stabilization-leg')."</legend>";
907908 $form .= "<table><tr>";
908909 $form .= "<td>".Xml::hidden( 'title', $wgTitle->getPrefixedText() )."</td>";
909910 $form .= "<td>".wfMsgHtml("stabilization-page")."</td>";
910 - $form .= "<td>".Xml::input('page', 40, $encPage, array( 'id' => 'page' ) )."</td>";
 911+ $form .= "<td>".Xml::input('page', 40, $pageName, array( 'id' => 'page' ) )."</td>";
911912 $form .= "<td>".wfSubmitButton( wfMsgHtml( 'go' ) )."</td>";
912913 $form .= "</tr></table>";
913914 $form .= "</fieldset></form>\n";
@@ -924,8 +925,8 @@
925926 }
926927 // Get visiblity settings...
927928 $config = $wgFlaggedRevs->getVisibilitySettings( $this->page, true );
928 - $encselect = $this->select ? $this->select : $config['select'];
929 - $encoverride = $this->override ? $this->override : $config['override'];
 929+ $selectSetting = $this->select ? $this->select : $config['select'];
 930+ $overrideSetting = $this->override ? $this->override : $config['override'];
930931
931932 if( !$this->isAllowed ) {
932933 $form = '<p>'.wfMsgExt( 'stabilization-perm', array('parse'), $this->page->getPrefixedText() ).'</p>';
@@ -935,23 +936,24 @@
936937 $off = array();
937938 }
938939
939 - $form .= "<form name='stabilization' action='$wgScript' method='post'>";
 940+ $form .= Xml::openElement( 'form',
 941+ array( 'name' => 'stabilization', 'action' => $wgScript, 'method' => 'post' ) );
940942 $form .= "<fieldset><legend>".wfMsg('stabilization-select')."</legend>";
941943 $form .= "<table><tr>";
942944
943 - $form .= "<td>".Xml::radio( 'select', 0, (0==$encselect), array('id' => 'select1') + $off )."</td>";
 945+ $form .= "<td>".Xml::radio( 'select', 0, (0==$selectSetting), array('id' => 'select1') + $off )."</td>";
944946 $form .= "<td>".Xml::label( wfMsg('stabilization-select1'), 'select1' )."</td>";
945947 $form .= "</tr><tr>";
946 - $form .= "<td>".Xml::radio( 'select', 1, (1==$encselect), array('id' => 'select2') + $off )."</td>";
 948+ $form .= "<td>".Xml::radio( 'select', 1, (1==$selectSetting), array('id' => 'select2') + $off )."</td>";
947949 $form .= "<td>".Xml::label( wfMsg('stabilization-select2'), 'select2' )."</td>";
948950 $form .= "</tr></table></fieldset>";
949951
950952 $form .= "<fieldset><legend>".wfMsg('stabilization-def')."</legend>";
951953 $form .= "<table><tr>";
952 - $form .= "<td>".Xml::radio( 'override', 1, (1==$encoverride), array('id' => 'default1') + $off)."</td>";
 954+ $form .= "<td>".Xml::radio( 'override', 1, (1==$overrideSetting), array('id' => 'default1') + $off)."</td>";
953955 $form .= "<td>".Xml::label( wfMsg('stabilization-def1'), 'default1' )."</td>";
954956 $form .= "</tr><tr>";
955 - $form .= "<td>".Xml::radio( 'override', 0, (0==$encoverride), array('id' => 'default2') + $off)."</td>";
 957+ $form .= "<td>".Xml::radio( 'override', 0, (0==$overrideSetting), array('id' => 'default2') + $off)."</td>";
956958 $form .= "<td>".Xml::label( wfMsg('stabilization-def2'), 'default2' )."</td>";
957959 $form .= "</tr></table></fieldset>";
958960 if( $this->isAllowed ) {

Status & tagging log