r110087 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110086‎ | r110087 | r110088 >
Date:21:58, 26 January 2012
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
Bug 33977 - check for invalid timestamps
Modified paths:
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.i18n.php (modified) (history)
  • /trunk/extensions/FeaturedFeeds/SpecialFeedItem.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/SpecialFeedItem.php
@@ -21,7 +21,12 @@
2222 return;
2323 }
2424 $feed = $feeds[$feedName];
25 - $date = FeaturedFeeds::startOfDay( wfTimestamp( TS_UNIX, $date ) );
 25+ $timestamp = wfTimestamp( TS_UNIX, $date );
 26+ if ( !$timestamp ) {
 27+ $out->showErrorPage( 'error', 'ffeed-invalid-timestamp' );
 28+ return;
 29+ }
 30+ $date = FeaturedFeeds::startOfDay( $timestamp );
2631 // First, search in the general cache
2732 foreach ( $feed->getFeedItems() as $item ) {
2833 if ( $item->getRawDate() == $date ) {
Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.i18n.php
@@ -17,6 +17,7 @@
1818 'ffeed-feed-not-found' => 'Feed $1 not found',
1919 'ffeed-entry-not-found' => 'Feed entry for $1 not found',
2020 'ffeed-sidebar-section' => 'Featured content feeds',
 21+ 'ffeed-invalid-timestamp' => 'Invalid feed timestamp',
2122
2223 # Featured Article
2324 'ffeed-featured-page' => '', # do not localise

Follow-up revisions

RevisionCommit summaryAuthorDate
r110148Purge cache upon changs to feed messagesmaxsem17:13, 27 January 2012

Comments

#Comment by Krinkle (talk | contribs)   02:20, 27 February 2012

This wasn't merged yet (I see no follow-ups). If that is the case, do we still need it? 1.19 was branched after this so it'll be in 1.19.0 and already is in 1.19wmf1. Untagging for now, feel free to re-tag.

Status & tagging log