From: Tim Starling Date: Mon, 6 Oct 2008 08:21:41 +0000 (+0000) Subject: (bug 15563) port PHP bug workaround to Parser_OldPP X-Git-Tag: 1.31.0-rc.0~44891 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=568876c99b2f4fac74217595a4e0feb9e05a249b;p=lhc%2Fweb%2Fwiklou.git (bug 15563) port PHP bug workaround to Parser_OldPP --- 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;