Skip to content

Commit

Permalink
zendframework#6058 - Timestamp filter is now skipping events without …
Browse files Browse the repository at this point in the history
…a timestamp
  • Loading branch information
Ocramius authored and dima committed Nov 27, 2014
1 parent 29070ca commit e8d9121
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion library/Zend/Log/Filter/Timestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ public function __construct($value, $dateFormatChar = null, $operator = '<=')
*/
public function filter(array $event)
{
$datetime = $event['timestamp'];
if (! isset($event['timestamp'])) {
return false;
}

$datetime = $event['timestamp'];

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

$timestamp = $datetime->getTimestamp();

if ($this->value instanceof DateTime) {
Expand Down

0 comments on commit e8d9121

Please sign in to comment.