Skip to content

Commit

Permalink
Merge pull request #198 from alexdebril/feature/fix-last-modified
Browse files Browse the repository at this point in the history
Compare "lastModified" to 1970-01-01
  • Loading branch information
alexdebril authored Dec 21, 2018
2 parents 4cc135d + a35f0b0 commit 6f3bad7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FeedIo/Reader/Fixer/LastModified.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class LastModified extends FixerAbstract
*/
public function correct(FeedInterface $feed) : FixerAbstract
{
if (is_null($feed->getLastModified())) {
$date = new \DateTime('@0');
if (is_null($feed->getLastModified()) || $feed->getLastModified() == $date ) {
$this->logger->notice("correct last modified date for feed {$feed->getTitle()}");
$feed->setLastModified(
$this->searchLastModified($feed)
Expand Down

0 comments on commit 6f3bad7

Please sign in to comment.