ares Posted May 19, 2025 at 07:58 PM Share Posted May 19, 2025 at 07:58 PM (edited) Версия Opencart: 3.0.3.8-ce.1.4 Версия PHP: 8.1 В режиме: maintenance_mode (Режим обслуживания) Вылезает ошибка: Unknown: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in D:\LocalServer\home\site.loc\storage\modification\system\engine\action.php on line 65 На PHP 7.4 - ошибки нет. UPD: В итоге, в файле system/engine/action.php добавил защиту от null и нестроковых значений: Заменил $this->id = $route; На $this->id = $route ?? ''; Заменил $parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route)); На $route = (string)($route ?? ''); $parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', $route)); Заменил $class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route); На $class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', (string)$this->route); Edited May 20, 2025 at 10:38 AM by ares 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.