From: Conrad Irwin Date: Sat, 13 Feb 2010 02:22:14 +0000 (+0000) Subject: Deprecate old undocumented workaround to bug 2257 (setTransparentTagHook) X-Git-Tag: 1.31.0-rc.0~37783 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=ae1e32d35036287346de6cd1bf08d8ab51e6dcb8;p=lhc%2Fweb%2Fwiklou.git Deprecate old undocumented workaround to bug 2257 (setTransparentTagHook) --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 9f3d89f261..6cddaf3fa2 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -374,25 +374,26 @@ class Parser wfRunHooks( 'ParserBeforeTidy', array( &$this, &$text ) ); -//!JF Move to its own function - - $uniq_prefix = $this->mUniqPrefix; - $matches = array(); - $elements = array_keys( $this->mTransparentTagHooks ); - $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix ); - - foreach( $matches as $marker => $data ) { - list( $element, $content, $params, $tag ) = $data; - $tagName = strtolower( $element ); - if( isset( $this->mTransparentTagHooks[$tagName] ) ) { - $output = call_user_func_array( $this->mTransparentTagHooks[$tagName], - array( $content, $params, $this ) ); - } else { - $output = $tag; + if ( $this->mTransparentTagHooks ) { + //!JF Move to its own function + $uniq_prefix = $this->mUniqPrefix; + $matches = array(); + $elements = array_keys( $this->mTransparentTagHooks ); + $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix ); + + foreach( $matches as $marker => $data ) { + list( $element, $content, $params, $tag ) = $data; + $tagName = strtolower( $element ); + if( isset( $this->mTransparentTagHooks[$tagName] ) ) { + $output = call_user_func_array( $this->mTransparentTagHooks[$tagName], + array( $content, $params, $this ) ); + } else { + $output = $tag; + } + $this->mStripState->general->setPair( $marker, $output ); } - $this->mStripState->general->setPair( $marker, $output ); + $text = $this->mStripState->unstripGeneral( $text ); } - $text = $this->mStripState->unstripGeneral( $text ); $text = Sanitizer::normalizeCharReferences( $text ); @@ -4243,7 +4244,9 @@ class Parser return $oldVal; } + /* An old work-around for bug 2257 - deprecated 2010-02-13 */ function setTransparentTagHook( $tag, $callback ) { + wfDeprecated( __METHOD__ ); $tag = strtolower( $tag ); $oldVal = isset( $this->mTransparentTagHooks[$tag] ) ? $this->mTransparentTagHooks[$tag] : null; $this->mTransparentTagHooks[$tag] = $callback;