From bbc2b0fdb1264595b6fff52f7da21521bfd29003 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Sun, 18 Dec 2011 01:46:25 +0000 Subject: [PATCH] followup r88898 -- move BeforeInitialize hook to where it can be called in a way that matches the documented parameters As it was, when an extension tried to use BeforeInitialize with the documented parameters this resulted in an exception: Detected bug in an extension! Hook HookFunctionName has invalid call signature; Parameter 2 to HookFunctionName() expected to be a reference, value given --- includes/Wiki.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 996302e231..8b62139b87 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -146,9 +146,6 @@ class MediaWiki { $output->setPrintable(); } - wfRunHooks( 'BeforeInitialize', - array( &$title, null, &$output, &$user, $request, $this ) ); - // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty. if ( is_null( $title ) || ( $title->getDBkey() == '' && $title->getInterwiki() == '' ) || $title->isSpecial( 'Badtitle' ) ) @@ -270,6 +267,8 @@ class MediaWiki { wfProfileOut( __METHOD__ ); throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" ); } + wfRunHooks( 'BeforeInitialize', + array( &$title, &$article, &$output, &$user, $request, $this ) ); } if ( $pageView ) { -- 2.20.1