Merge "Change php extract() to explicit code"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 10a338e..078de3c 100644 (file)
@@ -3114,10 +3114,29 @@ class Parser {
                                        throw $ex;
                                }
 
-                               # The interface for parser functions allows for extracting
-                               # flags into the local scope. Extract any forwarded flags
-                               # here.
-                               extract( $result );
+                               // Extract any forwarded flags
+                               if ( isset( $result['found'] ) ) {
+                                       $found = $result['found'];
+                               }
+                               if ( array_key_exists( 'text', $result ) ) {
+                                       // a string or null
+                                       $text = $result['text'];
+                               }
+                               if ( isset( $result['nowiki'] ) ) {
+                                       $nowiki = $result['nowiki'];
+                               }
+                               if ( isset( $result['isHTML'] ) ) {
+                                       $isHTML = $result['isHTML'];
+                               }
+                               if ( isset( $result['forceRawInterwiki'] ) ) {
+                                       $forceRawInterwiki = $result['forceRawInterwiki'];
+                               }
+                               if ( isset( $result['isChildObj'] ) ) {
+                                       $isChildObj = $result['isChildObj'];
+                               }
+                               if ( isset( $result['isLocalObj'] ) ) {
+                                       $isLocalObj = $result['isLocalObj'];
+                               }
                        }
                }
 
@@ -3862,11 +3881,12 @@ class Parser {
                        }
 
                        if ( is_array( $output ) ) {
-                               # Extract flags to local scope (to override $markerType)
+                               // Extract flags
                                $flags = $output;
                                $output = $flags[0];
-                               unset( $flags[0] );
-                               extract( $flags );
+                               if ( isset( $flags['markerType'] ) ) {
+                                       $markerType = $flags['markerType'];
+                               }
                        }
                } else {
                        if ( is_null( $attrText ) ) {