From 9a5d9a71d201885dc7939c38f6b3406046ecf7af Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 5 Jun 2023 20:09:54 +0700 Subject: [PATCH] Fixed some deprecations (#777) --- common.php | 2 +- src/Legacy/SqlDb.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.php b/common.php index 66c689206..2d37ec68e 100644 --- a/common.php +++ b/common.php @@ -276,7 +276,7 @@ function clean_filename($fname) */ function str_compact($str) { - return preg_replace('#\s+#u', ' ', trim($str)); + return preg_replace('#\s+#u', ' ', trim($str ?? '')); } /** diff --git a/src/Legacy/SqlDb.php b/src/Legacy/SqlDb.php index 9696535b6..280778ccb 100644 --- a/src/Legacy/SqlDb.php +++ b/src/Legacy/SqlDb.php @@ -1012,7 +1012,7 @@ class SqlDb $this->explain_hold .= ''; foreach (array_values($row) as $i => $val) { $class = !($i % 2) ? 'row1' : 'row2'; - $this->explain_hold .= '' . str_replace(["{$this->selected_db}.", ',', ';'], ['', ', ', ';
'], $val) . ''; + $this->explain_hold .= '' . str_replace(["{$this->selected_db}.", ',', ';'], ['', ', ', ';
'], $val ?? '') . ''; } $this->explain_hold .= '';