fix PHP TypeError "first param must be string, not null", if backup-dir does not exist

This commit is contained in:
ralf 2024-10-22 11:02:51 +02:00
parent 8da7b09bfa
commit 18ba129be8

View File

@ -201,12 +201,12 @@ class Backup
} }
if (!$name) if (!$name)
{ {
$name = $this->backup_dir.'/db_backup-'.date('YmdHi');
if (empty($this->backup_dir) || !is_writable($this->backup_dir)) 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)); $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)); 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 // remove the extension, to use the correct wrapper based on the extension
elseif ($un_compress) elseif ($un_compress)