From: Tim Starling Date: Wed, 3 Feb 2010 05:07:57 +0000 (+0000) Subject: Remove tag hook for now, pending resolution of implementation issues as discussed... X-Git-Tag: 1.31.0-rc.0~37965 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=5ff4947c48940be38bdb96a924b3ac788f38085a;p=lhc%2Fweb%2Fwiklou.git Remove tag hook for now, pending resolution of implementation issues as discussed on CR r58717. --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 1805b15a5e..67ec76088a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -129,7 +129,7 @@ class Parser $this->mFunctionHooks = array(); $this->mFunctionTagHooks = array(); $this->mFunctionSynonyms = array( 0 => array(), 1 => array() ); - $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery', 'a' ); + $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery' ); $this->mUrlProtocols = wfUrlProtocols(); $this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'. '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x0a\\x0d]*?)\]/S'; @@ -3308,9 +3308,6 @@ class Parser case 'gallery': $output = $this->renderImageGallery( $content, $attributes ); break; - case 'a': - $output = $this->renderHyperlink( $content, $attributes, $frame ); - break; case 'math': if ( $this->mOptions->getUseTeX() ) { $output = $wgContLang->armourMath( @@ -4357,35 +4354,6 @@ class Parser ''; } - /** - * Tag hook handler for 'a'. Renders a HTML <a> tag, allowing most attributes, filtering href against - * allowed protocols and spam blacklist. - **/ - function renderHyperlink( $text, $params, $frame = false ) { - foreach ( $params as $name => $value ) { - $params[ $name ] = $this->replaceVariables( $value, $frame ); - } - - $whitelist = Sanitizer::attributeWhitelist( 'a' ); - $params = Sanitizer::validateAttributes( $params, $whitelist ); - - $content = $this->recursiveTagParse( trim( $text ), $frame ); - - if ( isset( $params[ 'href' ] ) ) { - $href = $params[ 'href' ]; - $this->mOutput->addExternalLink( $href ); - unset( $params[ 'href' ] ); - } else { - # Non-link tag - return Xml::openElement( 'a', $params ) . $content . Xml::closeElement( 'a' ); - } - - $sk = $this->mOptions->getSkin(); - $html = $sk->makeExternalLink( $href, $content, false, '', $params ); - - return $html; - } - /** * Renders an image gallery from a text with one line per image. * text labels may be given by using |-style alternative text. E.g.