From: Ævar Arnfjörð Bjarmason Date: Sun, 15 Jan 2006 03:28:36 +0000 (+0000) Subject: * Fixed regression in last commit: If we don't check for existance we'll get X-Git-Tag: 1.6.0~535 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=bba0069640379259f9416d78c3517a7394e9135d;p=lhc%2Fweb%2Fwiklou.git * 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 --- 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) {