Skip to content

Commit

Permalink
Catch empty deprecation.log silently (fixes #31050)
Browse files Browse the repository at this point in the history
  • Loading branch information
althaus committed Apr 11, 2019
1 parent 9dfd8f1 commit 9fded1f
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -127,9 +127,13 @@ private function getContainerDeprecationLogs()
return [];
}

if ('' === $logContent = trim(file_get_contents($file))) {
return [];
}

$bootTime = filemtime($file);
$logs = [];
foreach (unserialize(file_get_contents($file)) as $log) {
foreach (unserialize($logContent) as $log) {
$log['context'] = ['exception' => new SilencedErrorContext($log['type'], $log['file'], $log['line'], $log['trace'], $log['count'])];
$log['timestamp'] = $bootTime;
$log['priority'] = 100;
Expand Down

0 comments on commit 9fded1f

Please sign in to comment.