From bba0069640379259f9416d78c3517a7394e9135d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 15 Jan 2006 03:28:36 +0000 Subject: [PATCH] * Fixed regression in last commit: If we don't check for existance we'll get "Trying to get property of non-object" E_NOTICE in Article::loadPageData() when viewing a page that does not exist --- includes/Wiki.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index ba4ec0b48f..70aa25c1fa 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -205,7 +205,13 @@ class MediaWiki { if( $action == 'view' && !$request->getVal( 'oldid' ) && $request->getVal( 'redirect' ) != 'no' ) { $dbr=&wfGetDB(DB_SLAVE); - $article->loadPageData($article->pageDataFromTitle($dbr,$title)); + + // If we don't check for existance we'll get "Trying to get + // property of non-object" E_NOTICE in Article::loadPageData() when + // viewing a page that does not exist + if ( $article->exists() ) { + $article->loadPageData($article->pageDataFromTitle($dbr,$title)); + } /* Follow redirects only for... redirects */ if ($article->mIsRedirect) { -- 2.20.1