From: jenkins-bot Date: Thu, 17 Aug 2017 22:16:27 +0000 (+0000) Subject: Merge "Restore the newFromId() approach in SpecialNewpages::feedItemDesc" X-Git-Tag: 1.31.0-rc.0~2370 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=089f7ec892a6e953fb4cd39a7c23f968fa79d8ab;hp=63a95228051a25185c70c0ae9615a4c3bbf852fe Merge "Restore the newFromId() approach in SpecialNewpages::feedItemDesc" --- 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() {