Skip to content

Commit 6ddcc53

Browse files
authored
Merge pull request #390 from nextcloud/backport/375/stable18
[stable18] (bugfix): Protect LogIterator.php from empty array indices
2 parents 040162b + c02ad78 commit 6ddcc53

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)