Merge "Chinese Conversion Table Update 2017-6"
[lhc/web/wiklou.git] / includes / parser / Preprocessor_DOM.php
index 7539307..5368125 100644 (file)
@@ -148,7 +148,6 @@ class Preprocessor_DOM extends Preprocessor {
         * @return PPNode_DOM
         */
        public function preprocessToObj( $text, $flags = 0 ) {
-
                $xml = $this->cacheGetTree( $text, $flags );
                if ( $xml === false ) {
                        $xml = $this->preprocessToXml( $text, $flags );
@@ -373,7 +372,6 @@ class Preprocessor_DOM extends Preprocessor {
                                }
                                // Handle comments
                                if ( isset( $matches[2] ) && $matches[2] == '!--' ) {
-
                                        // To avoid leaving blank lines, when a sequence of
                                        // space-separated comments is both preceded and followed by
                                        // a newline (ignoring spaces), then
@@ -561,8 +559,16 @@ class Preprocessor_DOM extends Preprocessor {
                                                'count' => $count ];
                                        $stack->push( $piece );
                                        $accum =& $stack->getAccum();
-                                       $flags = $stack->getFlags();
-                                       extract( $flags );
+                                       $stackFlags = $stack->getFlags();
+                                       if ( isset( $stackFlags['findEquals'] ) ) {
+                                               $findEquals = $stackFlags['findEquals'];
+                                       }
+                                       if ( isset( $stackFlags['findPipe'] ) ) {
+                                               $findPipe = $stackFlags['findPipe'];
+                                       }
+                                       if ( isset( $stackFlags['inHeading'] ) ) {
+                                               $inHeading = $stackFlags['inHeading'];
+                                       }
                                        $i += $count;
                                }
                        } elseif ( $found == 'line-end' ) {
@@ -612,8 +618,16 @@ class Preprocessor_DOM extends Preprocessor {
                                // Unwind the stack
                                $stack->pop();
                                $accum =& $stack->getAccum();
-                               $flags = $stack->getFlags();
-                               extract( $flags );
+                               $stackFlags = $stack->getFlags();
+                               if ( isset( $stackFlags['findEquals'] ) ) {
+                                       $findEquals = $stackFlags['findEquals'];
+                               }
+                               if ( isset( $stackFlags['findPipe'] ) ) {
+                                       $findPipe = $stackFlags['findPipe'];
+                               }
+                               if ( isset( $stackFlags['inHeading'] ) ) {
+                                       $inHeading = $stackFlags['inHeading'];
+                               }
 
                                // Append the result to the enclosing accumulator
                                $accum .= $element;
@@ -627,7 +641,7 @@ class Preprocessor_DOM extends Preprocessor {
                                $curLen = strlen( $curChar );
                                $count = ( $curLen > 1 ) ?
                                        # allow the final character to repeat
-                                       strspn( $text, $curChar[$curLen-1], $i+1 ) + 1 :
+                                       strspn( $text, $curChar[$curLen - 1], $i + 1 ) + 1 :
                                        strspn( $text, $curChar, $i );
 
                                # we need to add to stack only if opening brace count is enough for one of the rules
@@ -642,8 +656,16 @@ class Preprocessor_DOM extends Preprocessor {
 
                                        $stack->push( $piece );
                                        $accum =& $stack->getAccum();
-                                       $flags = $stack->getFlags();
-                                       extract( $flags );
+                                       $stackFlags = $stack->getFlags();
+                                       if ( isset( $stackFlags['findEquals'] ) ) {
+                                               $findEquals = $stackFlags['findEquals'];
+                                       }
+                                       if ( isset( $stackFlags['findPipe'] ) ) {
+                                               $findPipe = $stackFlags['findPipe'];
+                                       }
+                                       if ( isset( $stackFlags['inHeading'] ) ) {
+                                               $inHeading = $stackFlags['inHeading'];
+                                       }
                                } else {
                                        # Add literal brace(s)
                                        $accum .= htmlspecialchars( str_repeat( $curChar, $count ) );
@@ -750,8 +772,16 @@ class Preprocessor_DOM extends Preprocessor {
                                                $accum .= $s;
                                        }
                                }
-                               $flags = $stack->getFlags();
-                               extract( $flags );
+                               $stackFlags = $stack->getFlags();
+                               if ( isset( $stackFlags['findEquals'] ) ) {
+                                       $findEquals = $stackFlags['findEquals'];
+                               }
+                               if ( isset( $stackFlags['findPipe'] ) ) {
+                                       $findPipe = $stackFlags['findPipe'];
+                               }
+                               if ( isset( $stackFlags['inHeading'] ) ) {
+                                       $inHeading = $stackFlags['inHeading'];
+                               }
 
                                # Add XML element to the enclosing accumulator
                                $accum .= $element;