Skip to content

Commit 29114fb

Browse files
committed
fix: Copilot reviews
1 parent 91bcf64 commit 29114fb

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

functions.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ function syslog_partition_manage() {
243243

244244
if (syslog_partition_check('syslog', $time)) {
245245
syslog_partition_create('syslog', $time);
246-
$syslog_deleted = syslog_partition_remove('syslog', $time);
246+
$syslog_deleted = syslog_partition_remove('syslog');
247247
}
248248

249249
if (syslog_partition_check('syslog_removed', $time)) {
250250
syslog_partition_create('syslog_removed', $time);
251-
$syslog_deleted += syslog_partition_remove('syslog_removed', $time);
251+
$syslog_deleted += syslog_partition_remove('syslog_removed');
252252
}
253253

254254
return $syslog_deleted;
@@ -357,7 +357,7 @@ function syslog_partition_create($table, $time = null) {
357357
/**
358358
* Remove old partitions for the specified table.
359359
*
360-
* @param mixed $table
360+
* @param string $table The name of the table
361361
*/
362362
function syslog_partition_remove($table) {
363363
global $syslogdb_default;
@@ -368,6 +368,10 @@ function syslog_partition_remove($table) {
368368
return 0;
369369
}
370370

371+
if ($time === null) {
372+
$time = time();
373+
}
374+
371375
$lock_name = substr(hash('sha256', $syslogdb_default . '.syslog_partition_remove.' . $table), 0, 60);
372376

373377
$locked = syslog_db_fetch_cell_prepared('SELECT GET_LOCK(?, 10)', [$lock_name]);

syslog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ function syslog_filter($sql_where, $tab) {
13821382
ORDER BY selected DESC, host
13831383
LIMIT $ac_rows");
13841384
} else {
1385-
$hosts = syslog_db_fetch_assoc("SELECT DISTINCT sh.host_id, sh.host, '0 AS id
1385+
$hosts = syslog_db_fetch_assoc("SELECT DISTINCT sh.host_id, sh.host, '0' AS id
13861386
FROM `$syslogdb_default`.`syslog_hosts` AS sh
13871387
$hosts_where
13881388
ORDER BY host

0 commit comments

Comments
 (0)