From 03da248d50932f78fc82b84efc37ba1430f79a2b Mon Sep 17 00:00:00 2001 From: opencartbot Date: Sun, 26 Nov 2023 21:22:09 +0200 Subject: [PATCH] PHP 8 - null parameter Fix error on PHP 8: PHP Unknown: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /system/engine/action.php on line 65 --- upload/system/engine/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/system/engine/action.php b/upload/system/engine/action.php index bbb51e50f54..acfb9ef70da 100644 --- a/upload/system/engine/action.php +++ b/upload/system/engine/action.php @@ -62,7 +62,7 @@ public function execute($registry, array $args = array()) { } $file = DIR_APPLICATION . 'controller/' . $this->route . '.php'; - $class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route); + $class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', (string)$this->route); // Initialize the class if (is_file($file)) {