Skip to content

Commit dd42b6c

Browse files
solracsfbackportbot[bot]
authored andcommitted
fix(files_external): Check key exists before accessing it
Signed-off-by: Git'Fellow <[email protected]>
1 parent 0b65a3e commit dd42b6c

File tree

1 file changed

+8
-4
lines changed
  • apps/files_external/lib/Lib/Storage

1 file changed

+8
-4
lines changed

apps/files_external/lib/Lib/Storage/SFTP.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,14 @@ public function stat($path) {
471471
try {
472472
$stat = $this->getConnection()->stat($this->absPath($path));
473473

474-
$mtime = $stat ? (int)$stat['mtime'] : -1;
475-
$size = $stat ? (int)$stat['size'] : 0;
476-
477-
return ['mtime' => $mtime, 'size' => $size, 'ctime' => -1];
474+
$mtime = isset($stat['mtime']) ? (int)$stat['mtime'] : -1;
475+
$size = isset($stat['size']) ? (int)$stat['size'] : 0;
476+
477+
return [
478+
'mtime' => $mtime,
479+
'size' => $size,
480+
'ctime' => -1
481+
];
478482
} catch (\Exception $e) {
479483
return false;
480484
}

0 commit comments

Comments
 (0)