Skip to content

Commit 3530b43

Browse files
committed
Fix Error in scheduled jobs due to PHP 8 incompatibility, #6682
1 parent 3728238 commit 3530b43

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

server/lib/classes/backup.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,9 @@ protected static function generateExcludeList($backup_excludes, $arg, $pre='', $
14971497
foreach ($backup_excludes as $ex) {
14981498
# pass through escapeshellarg if not already done
14991499
if ( preg_match( "/^'.+'$/", $ex ) ) {
1500-
$excludes .= "${arg}${pre}${ex}${post} ";
1500+
$excludes .= "{$arg}{$pre}{$ex}{$post} ";
15011501
} else {
1502-
$excludes .= "${arg}" . escapeshellarg("${pre}${ex}${post}") . " ";
1502+
$excludes .= "{$arg}" . escapeshellarg("{$pre}{$ex}{$post}") . " ";
15031503
}
15041504
}
15051505

@@ -1870,8 +1870,8 @@ protected static function make_database_backup($web_domain, $backup_job)
18701870
//* Remove old backups
18711871
self::backups_garbage_collection($server_id, 'mysql', $domain_id);
18721872
$prefix_list = array(
1873-
"db_${db_name}_",
1874-
"manual-db_${db_name}_",
1873+
"db_{$db_name}_",
1874+
"manual-db_{$db_name}_",
18751875
);
18761876
self::clearBackups($server_id, $domain_id, intval($rec['backup_copies']), $db_backup_dir, $prefix_list);
18771877
}

server/lib/classes/cron.d/100-monitor_clamav_log.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public function onRunJob() {
9494

9595
/* Get the data of the log */
9696
$data = $this->_tools->_getLogData($type);
97+
if ($data == null) $data = "\n";
9798

9899
/* Get the data from the LAST log-Entry.
99100
* if there can be found:

server/lib/classes/cron.d/100-monitor_mail_queue.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function onRunJob() {
8282

8383
/* Get the data from the mailq */
8484
$data['output'] = shell_exec('mailq');
85+
if ($data['output'] == null) $data['output'] = "";
8586

8687
/*
8788
* The last line has more informations

server/lib/classes/cron.d/100-monitor_system_update.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function onRunJob() {
216216

217217
//* Ensure that output is encoded so that it does not break the serialize
218218
//$res['data']['output'] = htmlentities($res['data']['output']);
219-
$res['data']['output'] = htmlentities($res['data']['output'], ENT_QUOTES, 'UTF-8');
219+
$res['data']['output'] = $res['data']['output'] ? htmlentities($res['data']['output'], ENT_QUOTES, 'UTF-8') : null;
220220

221221
/*
222222
* Insert the data into the database

server/lib/classes/db_mysql.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ public function getDatabaseSize($database_name) {
668668
$clientdb_user = ($conf['db_user']) ? $conf['db_user'] : NULL;
669669
$clientdb_password = ($conf['db_password']) ? $conf['db_password'] : NULL;
670670
$clientdb_port = ((int)$conf['db_port']) ? (int)$conf['db_port'] : NULL;
671-
$clientdb_flags = ($conf['db_flags'] !== NULL) ? $conf['db_flags'] : NULL;
671+
$clientdb_flags = (isset($conf['db_flags']) && $conf['db_flags'] !== NULL) ? $conf['db_flags'] : NULL;
672672

673673
require_once 'lib/mysql_clientdb.conf';
674674

0 commit comments

Comments
 (0)