Skip to content

Commit

Permalink
PHP 8 - null parameter
Browse files Browse the repository at this point in the history
Fix error on PHP 8:
PHP Unknown:  preg_replace(): Passing null to parameter opencart#3 ($subject) of type array|string is deprecated in /system/engine/action.php on line 65
  • Loading branch information
opencartbot authored Nov 26, 2023
1 parent 03a3bc9 commit 03da248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion upload/system/engine/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 03da248

Please sign in to comment.