summaryrefslogtreecommitdiffstats
path: root/inc/database.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-10-06 15:52:35 +0200
committerSimon Rettberg2023-10-06 15:52:35 +0200
commit29c19060614ec2056a7dfa90415057f19191a404 (patch)
tree5ea21ee74fb7043add4ea7e7e6004114515e7583 /inc/database.inc.php
parent[inc/Database] Fix return type (diff)
downloadslx-admin-29c19060614ec2056a7dfa90415057f19191a404.tar.gz
slx-admin-29c19060614ec2056a7dfa90415057f19191a404.tar.xz
slx-admin-29c19060614ec2056a7dfa90415057f19191a404.zip
Fix a few deprecation warnings on PHP 8.2
Diffstat (limited to 'inc/database.inc.php')
-rw-r--r--inc/database.inc.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/database.inc.php b/inc/database.inc.php
index 81fd3259..0c8f40ae 100644
--- a/inc/database.inc.php
+++ b/inc/database.inc.php
@@ -268,7 +268,7 @@ class Database
$log = true;
}
foreach ($row as $key => $col) {
- $l = strlen($col);
+ $l = strlen((string)($col ?? 'NULL'));
if ($l > $lens[$key]) {
$lens[$key] = $l;
}
@@ -289,7 +289,7 @@ class Database
foreach ($rows as $row) {
$line = '';
foreach ($lens as $key => $len) {
- $line .= '| '. str_pad($row[$key], $len) . ' ';
+ $line .= '| '. str_pad((string)($row[$key] ?? 'NULL'), $len) . ' ';
}
error_log($line . "|");
}