r47504 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47503‎ | r47504 | r47505 >
Date:19:08, 19 February 2009
Author:aaron
Status:ok
Tags:
Comment:
escape $wgScript here
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListUserRestrictions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRestrictUser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRestrictUser.php
@@ -37,7 +37,8 @@
3838 class RestrictUserForm {
3939 public static function selectUserForm( $val = null, $error = null ) {
4040 global $wgScript, $wgTitle;
41 - $s = Xml::fieldset( wfMsg( 'restrictuser-userselect' ) ) . "<form action=\"{$wgScript}\">";
 41+ $action = htmlspecialchars( $wgScript );
 42+ $s = Xml::fieldset( wfMsg( 'restrictuser-userselect' ) ) . "<form action=\"{$action}\">";
4243 if( $error )
4344 $s .= '<p>' . $error . '</p>';
4445 $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
Index: trunk/phase3/includes/specials/SpecialListUserRestrictions.php
@@ -24,9 +24,10 @@
2525 class SpecialListUserRestrictionsForm {
2626 public function getHTML() {
2727 global $wgRequest, $wgScript, $wgTitle;
 28+ $action = htmlspecialchars( $wgScript );
2829 $s = '';
2930 $s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) );
30 - $s .= "<form action=\"{$wgScript}\">";
 31+ $s .= "<form action=\"{$action}\">";
3132 $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
3233 $s .= Xml::label( wfMsgHtml( 'listuserrestrictions-type' ), 'type' ) . '&nbsp;' .
3334 self::typeSelector( 'type', $wgRequest->getVal( 'type' ), 'type' );

Status & tagging log