jenkins-bot has submitted this change and it was merged.

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, 5 insertions(+), 2 deletions(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpecialFeedItem.php b/SpecialFeedItem.php
index f9f157a..de2d3a1 100644
--- a/SpecialFeedItem.php
+++ b/SpecialFeedItem.php
@@ -23,7 +23,10 @@
                $feed = $feeds[$feedName];
                $ts = new MWTimestamp( $date );
                $timestamp = $ts->getTimestamp();
-               if ( !$timestamp ) {
+               if ( !$timestamp
+                       || strlen( $timestamp ) !== 14 ) // @fixme: hack until 
Language::sprintfDate() learns to handle
+                                                    // timestamps >= Y10k
+               {
                        $out->showErrorPage( 'error', 'ffeed-invalid-timestamp' 
);
                        return;
                }
@@ -49,7 +52,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: merged
Gerrit-Change-Id: I8a600d37a2ba037096257ac65ec66eed0db11eb3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/FeaturedFeeds
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to