From 09f47fc2d039d1627206f07843a4044492f7bd41 Mon Sep 17 00:00:00 2001
From: Markus Birth <mbirth@gmail.com>
Date: Mon, 14 Feb 2022 21:57:57 +0100
Subject: [PATCH] escapeString() can get a null value.

---
 lib/Serendipity/Database/DbAbstract.php          | 2 +-
 lib/Serendipity/Database/MysqliDatabase.php      | 2 +-
 lib/Serendipity/Database/PdoPostgresDatabase.php | 2 +-
 lib/Serendipity/Database/PdoSqliteDatabase.php   | 2 +-
 lib/Serendipity/Database/PostgresDatabase.php    | 2 +-
 lib/Serendipity/Database/SqlRelayDatabase.php    | 2 +-
 lib/Serendipity/Database/Sqlite3Database.php     | 2 +-
 lib/Serendipity/Database/SqliteDatabase.php      | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/Serendipity/Database/DbAbstract.php b/lib/Serendipity/Database/DbAbstract.php
index 77a824c6..a8024b50 100644
--- a/lib/Serendipity/Database/DbAbstract.php
+++ b/lib/Serendipity/Database/DbAbstract.php
@@ -46,7 +46,7 @@ abstract class DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         return $string;
     }
diff --git a/lib/Serendipity/Database/MysqliDatabase.php b/lib/Serendipity/Database/MysqliDatabase.php
index e6a56379..97a22ff3 100644
--- a/lib/Serendipity/Database/MysqliDatabase.php
+++ b/lib/Serendipity/Database/MysqliDatabase.php
@@ -200,7 +200,7 @@ class MysqliDatabase extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         return mysqli_escape_string($this->db_conn, $string);
     }
diff --git a/lib/Serendipity/Database/PdoPostgresDatabase.php b/lib/Serendipity/Database/PdoPostgresDatabase.php
index dce3096d..b460f8e6 100644
--- a/lib/Serendipity/Database/PdoPostgresDatabase.php
+++ b/lib/Serendipity/Database/PdoPostgresDatabase.php
@@ -84,7 +84,7 @@ class PdoPostgresDatabase extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         return substr($this->db_conn->quote($string), 1, -1);
     }
diff --git a/lib/Serendipity/Database/PdoSqliteDatabase.php b/lib/Serendipity/Database/PdoSqliteDatabase.php
index c22949f5..9d399040 100644
--- a/lib/Serendipity/Database/PdoSqliteDatabase.php
+++ b/lib/Serendipity/Database/PdoSqliteDatabase.php
@@ -120,7 +120,7 @@ class PdoSqliteDatabase extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         return substr($this->db_conn->quote($string), 1, -1);
     }
diff --git a/lib/Serendipity/Database/PostgresDatabase.php b/lib/Serendipity/Database/PostgresDatabase.php
index e2c9334f..35ee73c5 100644
--- a/lib/Serendipity/Database/PostgresDatabase.php
+++ b/lib/Serendipity/Database/PostgresDatabase.php
@@ -89,7 +89,7 @@ class PostgresDatabase extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         return pg_escape_string($string);
     }
diff --git a/lib/Serendipity/Database/SqlRelayDatabase.php b/lib/Serendipity/Database/SqlRelayDatabase.php
index 05e3d6c9..c4f6ab5c 100644
--- a/lib/Serendipity/Database/SqlRelayDatabase.php
+++ b/lib/Serendipity/Database/SqlRelayDatabase.php
@@ -322,7 +322,7 @@ class SqlRelayDatabase extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         static $search  = array("\x00", '%',   "'",   '\"');
         static $replace = array('%00',  '%25', "''", '\\\"');
diff --git a/lib/Serendipity/Database/Sqlite3Database.php b/lib/Serendipity/Database/Sqlite3Database.php
index fb785a3a..72b1d846 100644
--- a/lib/Serendipity/Database/Sqlite3Database.php
+++ b/lib/Serendipity/Database/Sqlite3Database.php
@@ -60,7 +60,7 @@ class Sqlite3Database extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         static $search  = array("\x00", '%',   "'",   '\"');
         static $replace = array('%00',  '%25', "''", '\\\"');
diff --git a/lib/Serendipity/Database/SqliteDatabase.php b/lib/Serendipity/Database/SqliteDatabase.php
index 190cf18c..b052440e 100644
--- a/lib/Serendipity/Database/SqliteDatabase.php
+++ b/lib/Serendipity/Database/SqliteDatabase.php
@@ -64,7 +64,7 @@ class SqliteDatabase extends DbAbstract
     /**
      * Returns an escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
      */
-    public function escapeString(string $string): string
+    public function escapeString($string): string
     {
         static $search  = array("\x00", '%',   "'",   '\"');
         static $replace = array('%00',  '%25', "''", '\\\"');