summaryrefslogtreecommitdiff
path: root/includes/api/ApiFeedWatchlist.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiFeedWatchlist.php')
-rw-r--r--includes/api/ApiFeedWatchlist.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php
index d1beef8a..0ddb3c38 100644
--- a/includes/api/ApiFeedWatchlist.php
+++ b/includes/api/ApiFeedWatchlist.php
@@ -126,7 +126,8 @@ class ApiFeedWatchlist extends ApiBase {
$msg = wfMessage( 'watchlist' )->inContentLanguage()->text();
- $feedTitle = $this->getConfig()->get( 'Sitename' ) . ' - ' . $msg . ' [' . $this->getConfig()->get( 'LanguageCode' ) . ']';
+ $feedTitle = $this->getConfig()->get( 'Sitename' ) . ' - ' . $msg .
+ ' [' . $this->getConfig()->get( 'LanguageCode' ) . ']';
$feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL();
$feed = new $feedClasses[$params['feedformat']] (
@@ -168,6 +169,11 @@ class ApiFeedWatchlist extends ApiBase {
* @return FeedItem
*/
private function createFeedItem( $info ) {
+ if ( !isset( $info['title'] ) ) {
+ // Probably a revdeled log entry, skip it.
+ return null;
+ }
+
$titleStr = $info['title'];
$title = Title::newFromText( $titleStr );
$curidParam = array();
@@ -204,9 +210,14 @@ class ApiFeedWatchlist extends ApiBase {
}
$timestamp = $info['timestamp'];
- $user = $info['user'];
- $completeText = "$comment ($user)";
+ if ( isset( $info['user'] ) ) {
+ $user = $info['user'];
+ $completeText = "$comment ($user)";
+ } else {
+ $user = '';
+ $completeText = (string)$comment;
+ }
return new FeedItem( $titleStr, $completeText, $titleUrl, $timestamp, $user );
}