From 9a2b563a3f17674594487bf58ddab6850a12c0fd Mon Sep 17 00:00:00 2001 From: ebakernz Date: Tue, 6 Dec 2022 11:29:44 +1300 Subject: [PATCH 1/2] fix for null query --- src/SearchPageController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchPageController.php b/src/SearchPageController.php index 688e6e7..f9b4b72 100755 --- a/src/SearchPageController.php +++ b/src/SearchPageController.php @@ -162,7 +162,7 @@ public static function get_mapped_filters(){ public static function get_query($mysqlSafe = false){ $query = self::$query; if ($query) { - if ($mysqlSafe) { + if ($mysqlSafe && $query) { $query = str_replace("'", "\'", $query); $query = str_replace('"', '\"', $query); $query = str_replace('`', '\`', $query); From 6c6941287a8864b46010898e03a746af4686bc22 Mon Sep 17 00:00:00 2001 From: ebakernz Date: Tue, 6 Dec 2022 11:31:43 +1300 Subject: [PATCH 2/2] revert --- src/SearchPageController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchPageController.php b/src/SearchPageController.php index f9b4b72..688e6e7 100755 --- a/src/SearchPageController.php +++ b/src/SearchPageController.php @@ -162,7 +162,7 @@ public static function get_mapped_filters(){ public static function get_query($mysqlSafe = false){ $query = self::$query; if ($query) { - if ($mysqlSafe && $query) { + if ($mysqlSafe) { $query = str_replace("'", "\'", $query); $query = str_replace('"', '\"', $query); $query = str_replace('`', '\`', $query);