Skip to content

Commit

Permalink
zendframework#6058 - Timestamp filter now also checks integers and st…
Browse files Browse the repository at this point in the history
…rings
  • Loading branch information
Ocramius authored and dima committed Nov 27, 2014
1 parent 355c370 commit 5532314
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Log/Filter/Timestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ public function filter(array $event)

$datetime = $event['timestamp'];

if (! $datetime instanceof DateTime) {
if (! ($datetime instanceof DateTime || is_int($datetime) || is_string($datetime))) {
return false;
}

$timestamp = $datetime->getTimestamp();
$timestamp = $datetime instanceof DateTime ? $datetime->getTimestamp() : (int) $datetime;

if ($this->value instanceof DateTime) {
return version_compare($timestamp, $this->value->getTimestamp(), $this->operator);
Expand Down

0 comments on commit 5532314

Please sign in to comment.