From cf032181cd20e94bd714040f477aee9800f0fbb0 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sat, 22 Jan 2022 16:56:00 +0100 Subject: [PATCH] Fix also the other db drivers --- libraries/joomla/database/driver/mysql.php | 4 ++-- libraries/joomla/database/driver/pdo.php | 4 ++-- libraries/joomla/database/driver/pdomysql.php | 2 +- libraries/joomla/database/driver/postgresql.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/joomla/database/driver/mysql.php b/libraries/joomla/database/driver/mysql.php index a3efa9b6866f4..a7a82f5825c29 100644 --- a/libraries/joomla/database/driver/mysql.php +++ b/libraries/joomla/database/driver/mysql.php @@ -154,12 +154,12 @@ public function escape($text, $extra = false) if (is_float($text)) { // Force the dot as a decimal point. - return str_replace(',', '.', $text); + return str_replace(',', '.', (string) $text); } $this->connect(); - $result = mysql_real_escape_string($text, $this->getConnection()); + $result = mysql_real_escape_string((string) $text, $this->getConnection()); if ($extra) { diff --git a/libraries/joomla/database/driver/pdo.php b/libraries/joomla/database/driver/pdo.php index 78d3bba552135..1a256c1de437f 100644 --- a/libraries/joomla/database/driver/pdo.php +++ b/libraries/joomla/database/driver/pdo.php @@ -349,10 +349,10 @@ public function escape($text, $extra = false) if (is_float($text)) { // Force the dot as a decimal point. - return str_replace(',', '.', $text); + return str_replace(',', '.', (string) $text); } - $text = str_replace("'", "''", $text); + $text = str_replace("'", "''", (string) $text); return addcslashes($text, "\000\n\r\\\032"); } diff --git a/libraries/joomla/database/driver/pdomysql.php b/libraries/joomla/database/driver/pdomysql.php index 3d38bd991efa4..74ff282aa8762 100644 --- a/libraries/joomla/database/driver/pdomysql.php +++ b/libraries/joomla/database/driver/pdomysql.php @@ -464,7 +464,7 @@ public function escape($text, $extra = false) if (is_float($text)) { // Force the dot as a decimal point. - return str_replace(',', '.', $text); + return str_replace(',', '.', (string) $text); } $this->connect(); diff --git a/libraries/joomla/database/driver/postgresql.php b/libraries/joomla/database/driver/postgresql.php index 71dad35bcff6c..7bea2203bfb0b 100644 --- a/libraries/joomla/database/driver/postgresql.php +++ b/libraries/joomla/database/driver/postgresql.php @@ -212,12 +212,12 @@ public function escape($text, $extra = false) if (is_float($text)) { // Force the dot as a decimal point. - return str_replace(',', '.', $text); + return str_replace(',', '.', (string) $text); } $this->connect(); - $result = pg_escape_string($this->connection, $text); + $result = pg_escape_string($this->connection, (string) $text); if ($extra) {