Yaron Koren has submitted this change and it was merged.

Change subject: Fix for param parsing changes from r3bd2ec0
......................................................................


Fix for param parsing changes from r3bd2ec0

Previous parsing, in place since Nov. 2012, couldn't successfully parse
"local variables" with an underline, e.g. "a_b=c".

Change-Id: I6c6414610fddfe80898c8fe1e2b4278c38b386fd
---
M ED_ParserFunctions.php
M ED_Utils.php
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved



diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php
index 9b55251..8f03761 100644
--- a/ED_ParserFunctions.php
+++ b/ED_ParserFunctions.php
@@ -302,12 +302,13 @@
         */
        static function doExternalValue( &$parser, $local_var = '' ) {
                global $edgValues;
-               if ( ! array_key_exists( $local_var, $edgValues ) )
+               if ( ! array_key_exists( $local_var, $edgValues ) ) {
                        return '';
-               elseif ( is_array( $edgValues[$local_var] ) )
+               } elseif ( is_array( $edgValues[$local_var] ) ) {
                        return $edgValues[$local_var][0];
-               else
+               } else {
                        return $edgValues[$local_var];
+               }
        }
  
        /**
diff --git a/ED_Utils.php b/ED_Utils.php
index becd33a..2a7cdbf 100644
--- a/ED_Utils.php
+++ b/ED_Utils.php
@@ -75,7 +75,7 @@
        [,]
        (?=(?:(?:[^"]*"){2})*[^"]*$)
        (?=(?:(?:[^']*'){2})*[^']*$)
-       (?=(?:[[:alnum:]]+=))
+       (?=(?:[^()]*+\([^()]*+\))*+[^()]*+$)
        /x
 END;
                // " - fix for color highlighting in vi :)

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

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

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

Reply via email to