From d991a67dd048b40275806999279535cb5b629e77 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 15 Jan 2024 04:59:22 +0100 Subject: [PATCH] Cast input to int early --- upload/admin/controller/marketplace/modification.php | 2 +- upload/extension/opencart/catalog/controller/module/filter.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/upload/admin/controller/marketplace/modification.php b/upload/admin/controller/marketplace/modification.php index 3ae1d8d6ab2..0141b8933af 100644 --- a/upload/admin/controller/marketplace/modification.php +++ b/upload/admin/controller/marketplace/modification.php @@ -468,7 +468,7 @@ public function refresh(): void { $modification[$key] = implode("\n", $lines); } else { $search = trim($operation->getElementsByTagName('search')->item(0)->textContent); - $limit = $operation->getElementsByTagName('search')->item(0)->getAttribute('limit'); + $limit = (int)$operation->getElementsByTagName('search')->item(0)->getAttribute('limit'); $replace = trim($operation->getElementsByTagName('add')->item(0)->textContent); // Limit diff --git a/upload/extension/opencart/catalog/controller/module/filter.php b/upload/extension/opencart/catalog/controller/module/filter.php index f6bd1520229..93122240fae 100644 --- a/upload/extension/opencart/catalog/controller/module/filter.php +++ b/upload/extension/opencart/catalog/controller/module/filter.php @@ -16,7 +16,7 @@ public function index(): string { $parts = []; } - $category_id = end($parts); + $category_id = (int)end($parts); $this->load->model('catalog/category');