Merge "tests: Complete test coverage of HtmlArmor"
[lhc/web/wiklou.git] / includes / parser / Preprocessor_Hash.php
index 332f8e9..145fbbc 100644 (file)
@@ -497,7 +497,16 @@ class Preprocessor_Hash extends Preprocessor {
                                                'count' => $count ];
                                        $stack->push( $piece );
                                        $accum =& $stack->getAccum();
-                                       extract( $stack->getFlags() );
+                                       $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' ) {
@@ -554,7 +563,16 @@ class Preprocessor_Hash extends Preprocessor {
                                // Unwind the stack
                                $stack->pop();
                                $accum =& $stack->getAccum();
-                               extract( $stack->getFlags() );
+                               $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
                                array_splice( $accum, count( $accum ), 0, $element );
@@ -584,7 +602,16 @@ class Preprocessor_Hash extends Preprocessor {
 
                                        $stack->push( $piece );
                                        $accum =& $stack->getAccum();
-                                       extract( $stack->getFlags() );
+                                       $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)
                                        self::addLiteral( $accum, str_repeat( $curChar, $count ) );
@@ -695,7 +722,16 @@ class Preprocessor_Hash extends Preprocessor {
                                        }
                                }
 
-                               extract( $stack->getFlags() );
+                               $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
                                array_splice( $accum, count( $accum ), 0, $element );
@@ -1922,18 +1958,18 @@ class PPNode_Hash_Tree implements PPNode {
                                continue;
                        }
                        switch ( $child[self::NAME] ) {
-                       case 'name':
-                               $bits['name'] = new self( $children, $i );
-                               break;
-                       case 'attr':
-                               $bits['attr'] = new self( $children, $i );
-                               break;
-                       case 'inner':
-                               $bits['inner'] = new self( $children, $i );
-                               break;
-                       case 'close':
-                               $bits['close'] = new self( $children, $i );
-                               break;
+                               case 'name':
+                                       $bits['name'] = new self( $children, $i );
+                                       break;
+                               case 'attr':
+                                       $bits['attr'] = new self( $children, $i );
+                                       break;
+                               case 'inner':
+                                       $bits['inner'] = new self( $children, $i );
+                                       break;
+                               case 'close':
+                                       $bits['close'] = new self( $children, $i );
+                                       break;
                        }
                }
                if ( !isset( $bits['name'] ) ) {
@@ -2001,15 +2037,15 @@ class PPNode_Hash_Tree implements PPNode {
                                continue;
                        }
                        switch ( $child[self::NAME] ) {
-                       case 'title':
-                               $bits['title'] = new self( $children, $i );
-                               break;
-                       case 'part':
-                               $parts[] = new self( $children, $i );
-                               break;
-                       case '@lineStart':
-                               $bits['lineStart'] = '1';
-                               break;
+                               case 'title':
+                                       $bits['title'] = new self( $children, $i );
+                                       break;
+                               case 'part':
+                                       $parts[] = new self( $children, $i );
+                                       break;
+                               case '@lineStart':
+                                       $bits['lineStart'] = '1';
+                                       break;
                        }
                }
                if ( !isset( $bits['title'] ) ) {