From 6444714ca628f634817265c742fdd6a897af7a21 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 22 Dec 2008 07:35:56 +0000 Subject: [PATCH] Avoid extra page_touched query --- docs/hooks.txt | 1 + includes/Wiki.php | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 8f34d95dff..7b57de4c7b 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -753,6 +753,7 @@ $title: Title object ($wgTitle) $request: WebRequest $ignoreRedirect: boolean to skip redirect check $target: Title/string of redirect target +$article: Article object 'InitPreferencesForm': called at the end of PreferencesForm's constructor $form: the PreferencesForm diff --git a/includes/Wiki.php b/includes/Wiki.php index b05ae13b64..4dcad9a628 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -51,7 +51,7 @@ class MediaWiki { */ function initialize( &$title, &$article, &$output, &$user, $request ) { wfProfileIn( __METHOD__ ); - $this->preliminaryChecks( $title, $output, $request ) ; + $this->preliminaryChecks( $title, $output, $request ); if( !$this->initializeSpecialCases( $title, $output, $request ) ) { $new_article = $this->initializeArticle( $title, $request ); if( is_object( $new_article ) ) { @@ -131,7 +131,6 @@ class MediaWiki { * @param $request WebRequest */ function preliminaryChecks( &$title, &$output, $request ) { - if( $request->getCheck( 'search' ) ) { // Compatibility with old search URLs which didn't use Special:Search // Just check for presence here, so blank requests still @@ -140,7 +139,6 @@ class MediaWiki { // Do this above the read whitelist check for security... $title = SpecialPage::getTitleFor( 'Search' ); } - # If the user is not logged in, the Namespace:title of the article must be in # the Read array in order for the user to see it. (We have to check here to # catch special pages etc. We check again in Article::view()) @@ -149,7 +147,6 @@ class MediaWiki { $output->output(); exit; } - } /** @@ -309,7 +306,8 @@ class MediaWiki { $dbr = wfGetDB( DB_SLAVE ); $article->loadPageData( $article->pageDataFromTitle( $dbr, $title ) ); - wfRunHooks( 'InitializeArticleMaybeRedirect', array( &$title, &$request, &$ignoreRedirect, &$target ) ); + wfRunHooks( 'InitializeArticleMaybeRedirect', + array(&$title,&$request,&$ignoreRedirect,&$target,&$article) ); // Follow redirects only for... redirects if( !$ignoreRedirect && $article->isRedirect() ) { -- 2.20.1