From 5b8647d7701a7cf8c99269da59a56134f38f2ebc Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 24 Jun 2006 21:56:05 +0000 Subject: [PATCH] * Revert apparent breakage --- includes/Parser.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index cf692c98c8..e6ebb460c4 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2845,17 +2845,6 @@ class Parser $colonPos = strpos( $part1, ':' ); if ( $colonPos !== false ) { $function = strtolower( substr( $part1, 1, $colonPos - 1 ) ); - if ( !isset( $this->mFunctionHooks[$function] ) ) { - foreach ($this->mFunctionHooks as $key => $value) { - if( is_int( $key ) ) { - $mwExtension =& MagicWord::get( $key ); - if( $mwExtension->matchVariableStartToEnd( $function ) ) { - $function = $key; - break; - } - } - } - } if ( isset( $this->mFunctionHooks[$function] ) ) { $funcArgs = array_map( 'trim', $args ); $funcArgs = array_merge( array( &$this, trim( substr( $part1, $colonPos + 1 ) ) ), $funcArgs ); @@ -3894,17 +3883,15 @@ class Parser * * @public * - * @param mixed $id The magic word ID, or (deprecated) the function name. Function names are case-insensitive. + * @param string $name The function name. Function names are case-insensitive. * @param mixed $callback The callback function (and object) to use * * @return The old callback function for this name, if any */ - function setFunctionHook( $id, $callback ) { - if( is_string( $id ) ) { - $id = strtolower( $id ); - } - $oldVal = @$this->mFunctionHooks[$id]; - $this->mFunctionHooks[$id] = $callback; + function setFunctionHook( $name, $callback ) { + $name = strtolower( $name ); + $oldVal = @$this->mFunctionHooks[$name]; + $this->mFunctionHooks[$name] = $callback; return $oldVal; } -- 2.20.1