mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix(files_external): Check key exists before accessing it
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
b5347e89e7
commit
8a7cd1aefb
1 changed files with 7 additions and 3 deletions
|
|
@ -441,10 +441,14 @@ class SFTP extends Common {
|
|||
try {
|
||||
$stat = $this->getConnection()->stat($this->absPath($path));
|
||||
|
||||
$mtime = $stat ? (int)$stat['mtime'] : -1;
|
||||
$size = $stat ? (int)$stat['size'] : 0;
|
||||
$mtime = isset($stat['mtime']) ? (int)$stat['mtime'] : -1;
|
||||
$size = isset($stat['size']) ? (int)$stat['size'] : 0;
|
||||
|
||||
return ['mtime' => $mtime, 'size' => $size, 'ctime' => -1];
|
||||
return [
|
||||
'mtime' => $mtime,
|
||||
'size' => $size,
|
||||
'ctime' => -1
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue