From a7ce25c804c9f548ad043d3e8617f98b93e331b6 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Sat, 2 Jul 2005 15:13:08 +0000 Subject: [PATCH] don't just assume we get a valid title object --- includes/Article.php | 4 ++-- includes/EditPage.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 09c51612ba..a35d535c1b 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -99,7 +99,7 @@ class Article { # the revision text and put it in. if($preload) { $preloadTitle=Title::newFromText($preload); - if($preloadTitle->userCanRead()) { + if(isset($preloadTitle) && $preloadTitle->userCanRead()) { $rev=Revision::newFromTitle($preloadTitle); if($rev) { return $rev->getText(); @@ -114,7 +114,7 @@ class Article { wfProfileOut( $fname ); return wfMsg( 'noarticletext' ); - } else { + } else { $this->loadContent( $noredir ); # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page if ( $this->mTitle->getNamespace() == NS_USER_TALK && diff --git a/includes/EditPage.php b/includes/EditPage.php index 8729b94788..3bc5ade0c6 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -312,7 +312,7 @@ class EditPage { $addstandardintro=true; if($editintro) { $introtitle=Title::newFromText($editintro); - if($introtitle->userCanRead()) { + if(isset($introtitle) && $introtitle->userCanRead()) { $rev=Revision::newFromTitle($introtitle); if($rev) { $wgOut->addWikiText($rev->getText()); -- 2.20.1