r78628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78627‎ | r78628 | r78629 >
Date:17:58, 20 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fix for "unhandled" fields (fields contained in the template but not in the form) whose name contains a space
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php
@@ -49,8 +49,10 @@
5050 static function unhandledFieldsHTML( $template_contents ) {
5151 $text = "";
5252 foreach ( $template_contents as $key => $value ) {
53 - if ( $key != '' && !is_numeric( $key ) )
 53+ if ( !is_null( $key ) && !is_numeric( $key ) ) {
 54+ $key = urlencode( $key );
5455 $text .= self::hiddenFieldHTML( "_unhandled_$key", $value );
 56+ }
5557 }
5658 return $text;
5759 }
@@ -64,7 +66,7 @@
6567 $additional_template_text = "";
6668 foreach ( $wgRequest->getValues() as $key => $value ) {
6769 if ( substr( $key, 0, 11 ) == '_unhandled_' ) {
68 - $field_name = substr( $key, 11 );
 70+ $field_name = urldecode( substr( $key, 11 ) );
6971 $additional_template_text .= "|$field_name=$value\n";
7072 }
7173 }

Status & tagging log