From: Erik Moeller Date: Sat, 2 Jul 2005 15:13:08 +0000 (+0000) Subject: don't just assume we get a valid title object X-Git-Tag: 1.5.0beta2~76 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=a7ce25c804c9f548ad043d3e8617f98b93e331b6;p=lhc%2Fweb%2Fwiklou.git don't just assume we get a valid title object --- 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());