From 058bf13482fd246282408388e1f8a893fdbfd692 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 14 Nov 2022 16:23:50 +0100 Subject: Make sure to not pass null to DateTime::createFromFormat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/files_external/lib/Lib/Storage/FTP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/files_external/lib') diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php index d424ffe3cdd..998d147b7c7 100644 --- a/apps/files_external/lib/Lib/Storage/FTP.php +++ b/apps/files_external/lib/Lib/Storage/FTP.php @@ -123,7 +123,7 @@ class FTP extends Common { return $item['type'] === 'cdir'; })); if ($currentDir) { - $time = \DateTime::createFromFormat('YmdHis', $currentDir['modify']); + $time = \DateTime::createFromFormat('YmdHis', $currentDir['modify'] ?? ''); if ($time === false) { throw new \Exception("Invalid date format for directory: $currentDir"); } @@ -269,7 +269,7 @@ class FTP extends Common { case 'wb': case 'wb+': $useExisting = false; - // no break + // no break case 'a': case 'ab': case 'r+': -- cgit v1.2.3