From: Aaron Schulz Date: Thu, 17 Aug 2017 20:53:01 +0000 (-0700) Subject: Restore the newFromId() approach in SpecialNewpages::feedItemDesc X-Git-Tag: 1.31.0-rc.0~2370^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=f45b40fe531a8fa5324ebf4bc8a803ff694b044f;p=lhc%2Fweb%2Fwiklou.git Restore the newFromId() approach in SpecialNewpages::feedItemDesc Trying to use the row data is problematic since the text related fields are missing. This fixing a regression from 4475e1c8c. Also make SpecialNewpages::feedItemDesc() handle null content. Bug: T173541 Change-Id: I2213675d3392c6e9761bdc7acde35fd1caee4517 --- diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 6a7971435a..e3b73a98b0 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -494,17 +494,22 @@ class SpecialNewpages extends IncludableSpecialPage { } protected function feedItemDesc( $row ) { - $revision = $this->revisionFromRcResult( $row ); - if ( $revision ) { - // XXX: include content model/type in feed item? - return '

' . htmlspecialchars( $revision->getUserText() ) . - $this->msg( 'colon-separator' )->inContentLanguage()->escaped() . - htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . - "

\n
\n
" . - nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "
"; + $revision = Revision::newFromId( $row->rev_id ); + if ( !$revision ) { + return ''; } - return ''; + $content = $revision->getContent(); + if ( $content === null ) { + return ''; + } + + // XXX: include content model/type in feed item? + return '

' . htmlspecialchars( $revision->getUserText() ) . + $this->msg( 'colon-separator' )->inContentLanguage()->escaped() . + htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . + "

\n
\n
" . + nl2br( htmlspecialchars( $content->serialize() ) ) . "
"; } protected function getGroupName() {