jenkins-bot has submitted this change and it was merged.

Change subject: Avoid fatal in Article::fetchContent()
......................................................................


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
---
M includes/Article.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Manybubbles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Article.php b/includes/Article.php
index e73fe9d..0a4b5ee 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -386,6 +386,11 @@
 
                $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 ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/130835
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1924a42fa7b4227ac65838d0def6a66c3990573
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Manybubbles <never...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to