Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/110703
Change subject: Reject FeedItem timestamps set too far in the future
......................................................................
Reject FeedItem timestamps set too far in the future
Dates beyond 9999-12-31 either cannot be represented as MW_TS, or they can and
Language::sprintfDate cannot handle them. Either way, we have to screen such
values early.
Change-Id: I8a600d37a2ba037096257ac65ec66eed0db11eb3
---
M SpecialFeedItem.php
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FeaturedFeeds
refs/changes/03/110703/1
diff --git a/SpecialFeedItem.php b/SpecialFeedItem.php
index f9f157a..b63a614 100644
--- a/SpecialFeedItem.php
+++ b/SpecialFeedItem.php
@@ -23,7 +23,7 @@
$feed = $feeds[$feedName];
$ts = new MWTimestamp( $date );
$timestamp = $ts->getTimestamp();
- if ( !$timestamp ) {
+ if ( !$timestamp || strlen( $timestamp ) !== 14 ) {
$out->showErrorPage( 'error', 'ffeed-invalid-timestamp'
);
return;
}
@@ -49,7 +49,7 @@
$this->displayItem( $item );
} else {
$out->showErrorPage( 'error', 'ffeed-entry-not-found',
- array( $this->getLanguage()->date( $date ) )
+ array( $this->getLanguage()->date( $date,
false, false ) )
);
}
}
--
To view, visit https://gerrit.wikimedia.org/r/110703
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a600d37a2ba037096257ac65ec66eed0db11eb3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FeaturedFeeds
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits