Merge "Fix alpha transparency in XCF images"
[lhc/web/wiklou.git] / includes / parser / Preprocessor_Hash.php
index ad61eec..bf2bf61 100644 (file)
@@ -920,6 +920,7 @@ class PPFrame_Hash implements PPFrame {
        var $depth;
 
        private $volatile = false;
+       private $ttl = null;
 
        /**
         * @var array
@@ -1137,7 +1138,23 @@ class PPFrame_Hash implements PPFrame {
                                } elseif ( $contextNode->name == 'ext' ) {
                                        # Extension tag
                                        $bits = $contextNode->splitExt() + array( 'attr' => null, 'inner' => null, 'close' => null );
-                                       $out .= $this->parser->extensionSubstitution( $bits, $this );
+                                       if ( $flags & PPFrame::NO_TAGS ) {
+                                               $s = '<' . $bits['name']->firstChild->value;
+                                               if ( $bits['attr'] ) {
+                                                       $s .= $bits['attr']->firstChild->value;
+                                               }
+                                               if ( $bits['inner'] ) {
+                                                       $s .= '>' . $bits['inner']->firstChild->value;
+                                                       if ( $bits['close'] ) {
+                                                               $s .= $bits['close']->firstChild->value;
+                                                       }
+                                               } else {
+                                                       $s .= '/>';
+                                               }
+                                               $out .= $s;
+                                       } else {
+                                               $out .= $this->parser->extensionSubstitution( $bits, $this );
+                                       }
                                } elseif ( $contextNode->name == 'h' ) {
                                        # Heading
                                        if ( $this->parser->ot['html'] ) {
@@ -1410,6 +1427,26 @@ class PPFrame_Hash implements PPFrame {
        function isVolatile() {
                return $this->volatile;
        }
+
+       /**
+        * Set the TTL
+        *
+        * @param int $ttl
+        */
+       function setTTL( $ttl ) {
+               if ( $ttl !== null && ( $this->ttl === null || $ttl < $this->ttl ) ) {
+                       $this->ttl = $ttl;
+               }
+       }
+
+       /**
+        * Get the TTL
+        *
+        * @return int|null
+        */
+       function getTTL() {
+               return $this->ttl;
+       }
 }
 
 /**
@@ -1585,6 +1622,11 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
                parent::setVolatile( $flag );
                $this->parent->setVolatile( $flag );
        }
+
+       function setTTL( $ttl ) {
+               parent::setTTL( $ttl );
+               $this->parent->setTTL( $ttl );
+       }
 }
 
 /**