Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/53193


Change subject: Fix for lowercasing with 'use xpath' - found by Dan Bolser
......................................................................

Fix for lowercasing with 'use xpath' - found by Dan Bolser

Change-Id: I387d1a21f748e6fa3a204ed33e3c2b6bf828e97f
---
M ED_ParserFunctions.php
1 file changed, 11 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalData 
refs/changes/93/53193/1

diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php
index ed71010..93c0f05 100644
--- a/ED_ParserFunctions.php
+++ b/ED_ParserFunctions.php
@@ -139,13 +139,6 @@
                        return "URL is not allowed";
                }
 
-               if ( array_key_exists( 'data', $args ) ) {
-                       // parse the 'data' arg into mappings
-                       $mappings = EDUtils::paramToArray( $args['data'], 
false, true );
-               } else {
-                       return;
-               }
-
                if ( array_key_exists( 'format', $args ) ) {
                        $format = strtolower( $args['format'] );
                } else {
@@ -160,6 +153,17 @@
                        }
                }
 
+               if ( array_key_exists( 'data', $args ) ) {
+                       // parse the 'data' arg into mappings
+                       if ( $format == 'xml with xpath' ) {
+                               $mappings = EDUtils::paramToArray( 
$args['data'], false, false );
+                       } else {
+                               $mappings = EDUtils::paramToArray( 
$args['data'], false, true );
+                       }
+               } else {
+                       return;
+               }
+
                $postData = array_key_exists( 'post data', $args ) ? 
$args['post data'] : '';
                $external_values = EDUtils::getDataFromURL( $url, $format, 
$mappings, $postData );
                if ( is_string( $external_values ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/53193
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I387d1a21f748e6fa3a204ed33e3c2b6bf828e97f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ExternalData
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to