Skip to content

Commit

Permalink
Fix: Double date specification
Browse files Browse the repository at this point in the history
  • Loading branch information
radekbernatek committed Sep 18, 2014
1 parent 9325527 commit e8295f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/model/services/LogAnalyzerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ private function parseLine($line)
$matches['severity'] = 'Fatal error';
}

if (Nette\Utils\Strings::match($matches['date'], '#^(0-9\-){10}[a-zA-Z]+#') !== FALSE)
{
$matches['date'] = Nette\Utils\Strings::substring($matches['date'], 0, 10);
}

$error = [
'time' => new DateTime($matches['date'] . ' ' . str_replace('-', ':', $matches['time'])),
'severity' => $matches['severity'],
Expand Down

0 comments on commit e8295f6

Please sign in to comment.