Revision: 47957
Author:   yaron
Date:     2009-03-02 20:41:18 +0000 (Mon, 02 Mar 2009)

Log Message:
-----------
Fixed handling of fields with spaces in them

Modified Paths:
--------------
    trunk/extensions/ExternalData/ED_GetData.php

Modified: trunk/extensions/ExternalData/ED_GetData.php
===================================================================
--- trunk/extensions/ExternalData/ED_GetData.php        2009-03-02 20:29:09 UTC 
(rev 47956)
+++ trunk/extensions/ExternalData/ED_GetData.php        2009-03-02 20:41:18 UTC 
(rev 47957)
@@ -40,6 +40,7 @@
                $queried_headers = array();
                foreach( $wgRequest->getValues() as $key => $value ) {
                        foreach( $headers as $header_index => $header_value ) {
+                               $header_value = str_replace( ' ', '_', 
$header_value );
                                if( $key == $header_value ) {
                                        $queried_headers[$header_index] = 
$value;
                                }
@@ -51,8 +52,9 @@
                        if ($i == 0) continue;
                        $row_values = EDUtils::getValuesFromCSVLine( $line );
                        $found_match = true;
-                       foreach( $queried_headers as $i => $value ) {
-                               if ( $row_values[$i] != $value ) {
+                       foreach( $queried_headers as $i => $query_value ) {
+                               $single_value = str_replace( ' ', '_', 
$row_values[$i] );
+                               if ( $single_value != $query_value ) {
                                        $found_match = false;
                                }
                        }



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to