Trim arguments before they are passed to the function hooks
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 18 Apr 2006 02:48:48 +0000 (02:48 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 18 Apr 2006 02:48:48 +0000 (02:48 +0000)
includes/Parser.php

index a5e5978..0a920e8 100644 (file)
@@ -2673,7 +2673,8 @@ class Parser
                        if ( $colonPos !== false ) {
                                $function = strtolower( substr( $part1, 1, $colonPos - 1 ) );
                                if ( isset( $this->mFunctionHooks[$function] ) ) {
-                                       $funcArgs = array_merge( array( &$this, substr( $part1, $colonPos + 1 ) ), $args );
+                                       $funcArgs = array_map( 'trim', $args );
+                                       $funcArgs = array_merge( array( &$this, trim( substr( $part1, $colonPos + 1 ) ) ), $funcArgs );
                                        $result = call_user_func_array( $this->mFunctionHooks[$function], $funcArgs );
                                        $found = true;
                                        if ( is_array( $result ) ) {