From: Tim Starling Date: Mon, 12 Nov 2007 07:32:17 +0000 (+0000) Subject: Allow the special page function to be a callback, not just a function name. X-Git-Tag: 1.31.0-rc.0~50905 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=efbad45bd5dd69e029bcfdafa3b691c328340819;p=lhc%2Fweb%2Fwiklou.git Allow the special page function to be a callback, not just a function name. --- diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index b5820034ba..effea32dc3 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -643,7 +643,7 @@ class SpecialPage if ( $this->userCanExecute( $wgUser ) ) { $func = $this->mFunction; // only load file if the function does not exist - if(!function_exists($func) and $this->mFile) { + if(!is_callable($func) and $this->mFile) { require_once( $this->mFile ); } # FIXME: these hooks are broken for extensions and anything else that subclasses SpecialPage. @@ -651,7 +651,7 @@ class SpecialPage $this->outputHeader(); if ( ! wfRunHooks( 'SpecialPageExecuteBeforePage', array( &$this, &$par, &$func ) ) ) return; - $func( $par, $this ); + call_user_func( $func, $par, $this ); if ( ! wfRunHooks( 'SpecialPageExecuteAfterPage', array( &$this, &$par, &$func ) ) ) return; } else {