From b0bde1436d8c234eb4e864a34aa67653c6fa9874 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 15 Jan 2024 04:00:22 +0100 Subject: [PATCH] Cast strings to int after extracting the ID from a string --- upload/admin/controller/design/layout.php | 2 +- upload/catalog/controller/common/column_left.php | 2 +- upload/catalog/controller/common/column_right.php | 2 +- upload/catalog/controller/common/content_bottom.php | 2 +- upload/catalog/controller/common/content_top.php | 2 +- upload/catalog/controller/product/category.php | 2 +- upload/catalog/controller/product/product.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/upload/admin/controller/design/layout.php b/upload/admin/controller/design/layout.php index c343ef9f885..729dc018ba8 100644 --- a/upload/admin/controller/design/layout.php +++ b/upload/admin/controller/design/layout.php @@ -287,7 +287,7 @@ public function form(): void { 'edit' => $this->url->link('extension/' . $part[0] . '/module/' . $part[1], 'user_token=' . $this->session->data['user_token']) ]; } else { - $module_info = $this->model_setting_module->getModule($part[2]); + $module_info = $this->model_setting_module->getModule((int)$part[2]); if ($module_info) { $data['layout_modules'][] = [ diff --git a/upload/catalog/controller/common/column_left.php b/upload/catalog/controller/common/column_left.php index eb713977329..3a67801932a 100644 --- a/upload/catalog/controller/common/column_left.php +++ b/upload/catalog/controller/common/column_left.php @@ -78,7 +78,7 @@ public function index(): string { } if (isset($part[2])) { - $setting_info = $this->model_setting_module->getModule($part[2]); + $setting_info = $this->model_setting_module->getModule((int)$part[2]); if ($setting_info && $setting_info['status']) { $output = $this->load->controller('extension/' . $part[0] . '/module/' . $part[1], $setting_info); diff --git a/upload/catalog/controller/common/column_right.php b/upload/catalog/controller/common/column_right.php index 3a028a1c29c..079f874ba72 100644 --- a/upload/catalog/controller/common/column_right.php +++ b/upload/catalog/controller/common/column_right.php @@ -78,7 +78,7 @@ public function index(): string { } if (isset($part[2])) { - $setting_info = $this->model_setting_module->getModule($part[2]); + $setting_info = $this->model_setting_module->getModule((int)$part[2]); if ($setting_info && $setting_info['status']) { $output = $this->load->controller('extension/' . $part[0] . '/module/' . $part[1], $setting_info); diff --git a/upload/catalog/controller/common/content_bottom.php b/upload/catalog/controller/common/content_bottom.php index 321df4cf882..aa40c38fa18 100644 --- a/upload/catalog/controller/common/content_bottom.php +++ b/upload/catalog/controller/common/content_bottom.php @@ -78,7 +78,7 @@ public function index(): string { } if (isset($part[2])) { - $setting_info = $this->model_setting_module->getModule($part[2]); + $setting_info = $this->model_setting_module->getModule((int)$part[2]); if ($setting_info && $setting_info['status']) { $output = $this->load->controller('extension/' . $part[0] . '/module/' . $part[1], $setting_info); diff --git a/upload/catalog/controller/common/content_top.php b/upload/catalog/controller/common/content_top.php index 0ba32e4604d..17d15d4b6b9 100644 --- a/upload/catalog/controller/common/content_top.php +++ b/upload/catalog/controller/common/content_top.php @@ -78,7 +78,7 @@ public function index(): string { } if (isset($part[2])) { - $setting_info = $this->model_setting_module->getModule($part[2]); + $setting_info = $this->model_setting_module->getModule((int)$part[2]); if ($setting_info && $setting_info['status']) { $output = $this->load->controller('extension/' . $part[0] . '/module/' . $part[1], $setting_info); diff --git a/upload/catalog/controller/product/category.php b/upload/catalog/controller/product/category.php index d1903380088..b4643044b1f 100644 --- a/upload/catalog/controller/product/category.php +++ b/upload/catalog/controller/product/category.php @@ -91,7 +91,7 @@ public function index(): ?\Opencart\System\Engine\Action { $path .= '_' . (int)$path_id; } - $parent_info = $this->model_catalog_category->getCategory($path_id); + $parent_info = $this->model_catalog_category->getCategory((int)$path_id); if ($parent_info) { $data['breadcrumbs'][] = [ diff --git a/upload/catalog/controller/product/product.php b/upload/catalog/controller/product/product.php index 9e8743a9f3d..c5fe8d4f8d5 100644 --- a/upload/catalog/controller/product/product.php +++ b/upload/catalog/controller/product/product.php @@ -51,7 +51,7 @@ public function index(): ?\Opencart\System\Engine\Action { $path .= '_' . $path_id; } - $category_info = $this->model_catalog_category->getCategory($path_id); + $category_info = $this->model_catalog_category->getCategory((int)$path_id); if ($category_info) { $data['breadcrumbs'][] = [