Remove unused var assign in Parser::getTemplateDom
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 47d9a62..5b1e86d 100644 (file)
@@ -1610,9 +1610,7 @@ class Parser {
                                true, 'free',
                                $this->getExternalLinkAttribs( $url ), $this->mTitle );
                        # Register it in the output object...
-                       # Replace unnecessary URL escape codes with their equivalent characters
-                       $pasteurized = self::normalizeLinkUrl( $url );
-                       $this->mOutput->addExternalLink( $pasteurized );
+                       $this->mOutput->addExternalLink( $url );
                }
                return $text . $trail;
        }
@@ -1908,10 +1906,7 @@ class Parser {
                                $this->getExternalLinkAttribs( $url ), $this->mTitle ) . $dtrail . $trail;
 
                        # Register link in the output object.
-                       # Replace unnecessary URL escape codes with the referenced character
-                       # This prevents spammers from hiding links from the filters
-                       $pasteurized = self::normalizeLinkUrl( $url );
-                       $this->mOutput->addExternalLink( $pasteurized );
+                       $this->mOutput->addExternalLink( $url );
                }
 
                return $s;
@@ -3481,7 +3476,7 @@ class Parser {
 
                if ( !$title->equals( $cacheTitle ) ) {
                        $this->mTplRedirCache[$cacheTitle->getPrefixedDBkey()] =
-                               [ $title->getNamespace(), $cdb = $title->getDBkey() ];
+                               [ $title->getNamespace(), $title->getDBkey() ];
                }
 
                return [ $dom, $title ];
@@ -4975,7 +4970,7 @@ class Parser {
                $ig->setShowFilename( false );
                $ig->setParser( $this );
                $ig->setHideBadImages();
-               $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) );
+               $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'ul' ) );
 
                if ( isset( $params['showfilename'] ) ) {
                        $ig->setShowFilename( true );
@@ -5086,9 +5081,11 @@ class Parser {
                                                        }
                                                        if ( preg_match( "/^($prots)$addr$chars*$/u", $linkValue ) ) {
                                                                $link = $linkValue;
+                                                               $this->mOutput->addExternalLink( $link );
                                                        } else {
                                                                $localLinkTitle = Title::newFromText( $linkValue );
                                                                if ( $localLinkTitle !== null ) {
+                                                                       $this->mOutput->addLink( $localLinkTitle );
                                                                        $link = $localLinkTitle->getLinkURL();
                                                                }
                                                        }
@@ -5144,6 +5141,11 @@ class Parser {
                                $internalParamMap = [];
                                foreach ( $internalParamNames as $type => $names ) {
                                        foreach ( $names as $name ) {
+                                               // For grep: img_left, img_right, img_center, img_none,
+                                               // img_baseline, img_sub, img_super, img_top, img_text_top, img_middle,
+                                               // img_bottom, img_text_bottom,
+                                               // img_thumbnail, img_manualthumb, img_framed, img_frameless, img_upright,
+                                               // img_border, img_link, img_alt, img_class
                                                $magicName = str_replace( '-', '_', "img_$name" );
                                                $internalParamMap[$magicName] = [ $type, $name ];
                                        }