http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73599

Revision: 73599
Author:   yaron
Date:     2010-09-23 12:22:16 +0000 (Thu, 23 Sep 2010)

Log Message:
-----------
Added handling for GFF format, fixed bug in .urlencode handling

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

Modified: trunk/extensions/ExternalData/ED_ParserFunctions.php
===================================================================
--- trunk/extensions/ExternalData/ED_ParserFunctions.php        2010-09-23 
12:17:35 UTC (rev 73598)
+++ trunk/extensions/ExternalData/ED_ParserFunctions.php        2010-09-23 
12:22:16 UTC (rev 73599)
@@ -64,6 +64,8 @@
                        $external_values = EDUtils::getCSVData( $url_contents, 
true );
                } elseif ( $format == 'json' ) {
                        $external_values = EDUtils::getJSONData( $url_contents 
);
+               } elseif ( $format == 'gff' ) {
+                       $external_values = EDUtils::getGFFData( $url_contents );
                }
                // get set of filters and set of mappings, determining each
                // one by whether there's a double or single equals sign,
@@ -247,7 +249,8 @@
                                // if variable name ends with a ".urlencode",
                                // that's a command - URL-encode the value of
                                // the actual variable
-                               if ( strrpos( $variable, '.urlencode' ) == 
strlen( $variable ) - strlen( '.urlencode' ) ) {
+                               $loc_of_urlencode =  strrpos( $variable, 
'.urlencode' );
+                               if ( ( $loc_of_urlencode > 0 ) && ( 
$loc_of_urlencode == strlen( $variable ) - strlen( '.urlencode' ) ) ) {
                                        $real_var = str_replace( '.urlencode', 
'', $variable );
                                        $value = urlencode( 
self::getIndexedValue( $real_var , $i ) );
                                } else {



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

Reply via email to