From: Brad Jorsch Date: Thu, 1 May 2014 14:12:25 +0000 (-0400) Subject: Avoid fatal in Article::fetchContent() X-Git-Tag: 1.31.0-rc.0~15935 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=26d114090a04fc589cd00aa4432407b3e1ce01f5;p=lhc%2Fweb%2Fwiklou.git Avoid fatal in Article::fetchContent() The function is documented as returning false if there is no content to the page, but this logic was lost in the ContentHandler change. Even though it's "BC cruft", it still shouldn't fatal for something as simple as a non-existent page. Bug: 43737 Change-Id: Ic1924a42fa7b4227ac65838d0def6a66c3990573 --- diff --git a/includes/Article.php b/includes/Article.php index e73fe9d640..0a4b5ee30e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -386,6 +386,11 @@ class Article implements Page { $content = $this->fetchContentObject(); + if ( !$content ) { + wfProfileOut( __METHOD__ ); + return false; + } + // @todo Get rid of mContent everywhere! $this->mContent = ContentHandler::getContentText( $content ); ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) );