# Display the old title if the namespace/title has been changed
$oldTitleText = '';
$oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
+
+ if ( !$title->equals( $oldTitle ) ) {
+ $oldTitleText = $oldTitle->getPrefixedText();
+ $oldTitleText = Html::rawElement(
+ 'span',
+ [ 'class' => 'mw-newpages-oldtitle' ],
+ $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped()
+ );
+ }
+
$ret = "{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} "
. "{$tagDisplay} {$oldTitleText}";
$attribs['class'] = implode( ' ', $classes );
}
- if ( !$title->equals( $oldTitle ) ) {
- $oldTitleText = $oldTitle->getPrefixedText();
- $oldTitleText = Html::rawElement(
- 'span',
- [ 'class' => 'mw-newpages-oldtitle' ],
- $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped()
- );
- }
-
return Html::rawElement( 'li', $attribs, $ret ) . "\n";
}
}
protected function feedItemDesc( $row ) {
- $revision = $this->revisionFromRcResult( $row );
- if ( $revision ) {
- // XXX: include content model/type in feed item?
- return '<p>' . htmlspecialchars( $revision->getUserText() ) .
- $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
- htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
- "</p>\n<hr />\n<div>" .
- nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "</div>";
+ $revision = Revision::newFromId( $row->rev_id );
+ if ( !$revision ) {
+ return '';
+ }
+
+ $content = $revision->getContent();
+ if ( $content === null ) {
+ return '';
}
- return '';
+ // XXX: include content model/type in feed item?
+ return '<p>' . htmlspecialchars( $revision->getUserText() ) .
+ $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
+ htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
+ "</p>\n<hr />\n<div>" .
+ nl2br( htmlspecialchars( $content->serialize() ) ) . "</div>";
}
protected function getGroupName() {