* @return string
*/
protected function feedItemDesc( RevisionRecord $revision ) {
- if ( $revision ) {
- $msg = wfMessage( 'colon-separator' )->inContentLanguage()->text();
- try {
- $content = $revision->getContent( SlotRecord::MAIN );
- } catch ( RevisionAccessException $e ) {
- $content = null;
- }
-
- if ( $content instanceof TextContent ) {
- // only textual content has a "source view".
- $html = nl2br( htmlspecialchars( $content->getNativeData() ) );
- } else {
- // XXX: we could get an HTML representation of the content via getParserOutput, but that may
- // contain JS magic and generally may not be suitable for inclusion in a feed.
- // Perhaps Content should have a getDescriptiveHtml method and/or a getSourceText method.
- // Compare also FeedUtils::formatDiffRow.
- $html = '';
- }
-
- $comment = $revision->getComment();
+ $msg = wfMessage( 'colon-separator' )->inContentLanguage()->text();
+ try {
+ $content = $revision->getContent( SlotRecord::MAIN );
+ } catch ( RevisionAccessException $e ) {
+ $content = null;
+ }
- return '<p>' . htmlspecialchars( $this->feedItemAuthor( $revision ) ) . $msg .
- htmlspecialchars( FeedItem::stripComment( $comment ? $comment->text : '' ) ) .
- "</p>\n<hr />\n<div>" . $html . '</div>';
+ if ( $content instanceof TextContent ) {
+ // only textual content has a "source view".
+ $html = nl2br( htmlspecialchars( $content->getNativeData() ) );
+ } else {
+ // XXX: we could get an HTML representation of the content via getParserOutput, but that may
+ // contain JS magic and generally may not be suitable for inclusion in a feed.
+ // Perhaps Content should have a getDescriptiveHtml method and/or a getSourceText method.
+ // Compare also FeedUtils::formatDiffRow.
+ $html = '';
}
- return '';
+ $comment = $revision->getComment();
+
+ return '<p>' . htmlspecialchars( $this->feedItemAuthor( $revision ) ) . $msg .
+ htmlspecialchars( FeedItem::stripComment( $comment ? $comment->text : '' ) ) .
+ "</p>\n<hr />\n<div>" . $html . '</div>';
}
public function getAllowedParams() {