Skip to content

Commit 8deddff

Browse files
authored
Merge pull request #389 from nextcloud/backport/375/stable19
[stable19] (bugfix): Protect LogIterator.php from empty array indices
2 parents fc03f67 + d7f43bf commit 8deddff

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/Log/LogIterator.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ function rewind() {
7575
function current() {
7676
$entry = json_decode($this->lastLine, true);
7777
if ($this->dateFormat !== \DateTime::ATOM) {
78-
$time = \DateTime::createFromFormat($this->dateFormat, $entry['time'], $this->timezone);
79-
if ($time) {
80-
$entry['time'] = $time->format(\DateTime::ATOM);
78+
if (isset($entry['time'])) {
79+
$time = \DateTime::createFromFormat($this->dateFormat, $entry['time'], $this->timezone);
80+
if ($time) {
81+
$entry['time'] = $time->format(\DateTime::ATOM);
82+
}
8183
}
8284
}
8385
return $entry;

0 commit comments

Comments
 (0)