From 18ba129be8cc3f8eebe4b1da7ab7535a759242ce Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 22 Oct 2024 11:02:51 +0200 Subject: [PATCH] fix PHP TypeError "first param must be string, not null", if backup-dir does not exist --- api/src/Db/Backup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Db/Backup.php b/api/src/Db/Backup.php index f88fad7b0f..8c4750debd 100644 --- a/api/src/Db/Backup.php +++ b/api/src/Db/Backup.php @@ -201,12 +201,12 @@ class Backup } if (!$name) { + $name = $this->backup_dir.'/db_backup-'.date('YmdHi'); if (empty($this->backup_dir) || !is_writable($this->backup_dir)) { $this->log($name, $reading, null, lang("backupdir '%1' is not writeable by the webserver", $this->backup_dir)); throw new Exception(lang("backupdir '%1' is not writeable by the webserver", $this->backup_dir)); } - $name = $this->backup_dir.'/db_backup-'.date('YmdHi'); } // remove the extension, to use the correct wrapper based on the extension elseif ($un_compress)