From d710765f6f70a00914d2a644de13ac07dc0850da Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 4 Mar 2009 18:59:28 +0000 Subject: [PATCH] Renamed CoreParserFunctions::namespace() to CoreParserFunctions::mwnamespace() to not break PHP 5.3, was throwing an E_PARSE: "Unexpected T_NAMESPACE" --- includes/parser/CoreParserFunctions.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index b2080760d2..9c90d1bed5 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -48,7 +48,7 @@ class CoreParserFunctions { $parser->setFunctionHook( 'pagesincategory', array( __CLASS__, 'pagesincategory' ), SFH_NO_HASH ); $parser->setFunctionHook( 'pagesize', array( __CLASS__, 'pagesize' ), SFH_NO_HASH ); $parser->setFunctionHook( 'protectionlevel', array( __CLASS__, 'protectionlevel' ), SFH_NO_HASH ); - $parser->setFunctionHook( 'namespace', array( __CLASS__, 'namespace' ), SFH_NO_HASH ); + $parser->setFunctionHook( 'namespace', array( __CLASS__, 'mwnamespace' ), SFH_NO_HASH ); $parser->setFunctionHook( 'namespacee', array( __CLASS__, 'namespacee' ), SFH_NO_HASH ); $parser->setFunctionHook( 'talkspace', array( __CLASS__, 'talkspace' ), SFH_NO_HASH ); $parser->setFunctionHook( 'talkspacee', array( __CLASS__, 'talkspacee' ), SFH_NO_HASH ); @@ -271,11 +271,13 @@ class CoreParserFunctions { } - /* - * Given a title, return the namespace name that would be given by the - * corresponding magic word - */ - static function namespace( $parser, $title = null ) { + /** + * Given a title, return the namespace name that would be given by the + * corresponding magic word + * Note: function name changed to "mwnamespace" rather than "namespace" + * to not break PHP 5.3 + */ + static function mwnamespace( $parser, $title = null ) { $t = Title::newFromText( $title ); if ( is_null($t) ) return ''; -- 2.20.1