From 568876c99b2f4fac74217595a4e0feb9e05a249b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 6 Oct 2008 08:21:41 +0000 Subject: [PATCH] (bug 15563) port PHP bug workaround to Parser_OldPP --- includes/parser/Parser_OldPP.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/parser/Parser_OldPP.php b/includes/parser/Parser_OldPP.php index 106e439f47..177b98901b 100644 --- a/includes/parser/Parser_OldPP.php +++ b/includes/parser/Parser_OldPP.php @@ -578,6 +578,10 @@ class Parser_OldPP break; default: if( isset( $this->mTagHooks[$tagName] ) ) { + # Workaround for PHP bug 35229 and similar + if ( !is_callable( $this->mTagHooks[$tagName] ) ) { + throw new MWException( "Tag hook for $tagName is not callable\n" ); + } $output = call_user_func_array( $this->mTagHooks[$tagName], array( $content, $params, $this ) ); } else { @@ -3013,6 +3017,11 @@ class Parser_OldPP if ( $function ) { $funcArgs = array_map( 'trim', $args ); $funcArgs = array_merge( array( &$this, trim( substr( $part1, $colonPos + 1 ) ) ), $funcArgs ); + + # Workaround for PHP bug 35229 and similar + if ( !is_callable( $this->mFunctionHooks[$function] ) ) { + throw new MWException( "Function hook for $function is not callable\n" ); + } $result = call_user_func_array( $this->mFunctionHooks[$function], $funcArgs ); $found = true; -- 2.20.1