r83221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83220‎ | r83221 | r83222 >
Date:16:24, 4 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added URL-encoding to passed-in query string variables which are then sent on to Special:FormEdit
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -37,7 +37,7 @@
3838 // redirect to 'FormEdit' for this target page.
3939 if ( isset( $queryparts[1] ) ) {
4040 $target_name = $queryparts[1];
41 - SFFormStart::doRedirect( $form_name, $target_name, $params );
 41+ self::doRedirect( $form_name, $target_name, $params );
4242 }
4343
4444 // Get namespace from the URL, if it's there.
@@ -78,7 +78,7 @@
7979 $wgOut->addHTML( htmlspecialchars( wfMsg( 'sf_formstart_badtitle', $page_name ) ) );
8080 return;
8181 } else {
82 - SFFormStart::doRedirect( $form_name, $page_name, $params );
 82+ self::doRedirect( $form_name, $page_name, $params );
8383 return;
8484 }
8585 }
@@ -154,8 +154,10 @@
155155 // identify the latter because they show up as arrays.
156156 foreach ( $_REQUEST as $key => $val ) {
157157 if ( is_array( $val ) ) {
158 - $template_name = $key;
 158+ $template_name = urlencode( $key );
159159 foreach ( $val as $field_name => $value ) {
 160+ $field_name = urlencode( $field_name );
 161+ $value = urlencode( $value );
160162 $redirect_url .= ( strpos( $redirect_url, "?" ) > - 1 ) ? '&' : '?';
161163 $redirect_url .= $template_name . '[' . $field_name . ']=' . $value;
162164 }