From: X! Date: Mon, 3 Jan 2011 20:19:51 +0000 (+0000) Subject: Throw an exception if calling parent or self on MWFunction. X-Git-Tag: 1.31.0-rc.0~32858 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=76b8218e7596adc5704263fd7d7368941a987208;p=lhc%2Fweb%2Fwiklou.git Throw an exception if calling parent or self on MWFunction. --- diff --git a/includes/MWFunction.php b/includes/MWFunction.php index 0756ad24b0..8c646f6414 100644 --- a/includes/MWFunction.php +++ b/includes/MWFunction.php @@ -30,6 +30,14 @@ class MWFunction { } } + $callback = (array) $callback; + + if( count( $callback ) == 2 && $callback[0] == 'self' || $callback[0] == 'parent' ) { + + throw new MWException( 'MWFunction cannot call self::method() or parent::method()' ); + + } + // Run autoloader (workaround for call_user_func_array bug: http://bugs.php.net/bug.php?id=51329) is_callable( $callback );