From 4aef5a52d89f7a668d44df918d01bebe02b382ef Mon Sep 17 00:00:00 2001 From: vChabot Date: Fri, 3 Feb 2012 09:32:12 +0000 Subject: [PATCH] // replace $_POST by Tools::getValue --- classes/Category.php | 7 +++++-- classes/controller/AdminController.php | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/classes/Category.php b/classes/Category.php index 091fc84bf..17dfeae90 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -194,12 +194,15 @@ class CategoryCore extends ObjectModel if ($this->getDuplicatePosition()) { $assos = array(); - if (isset($_POST['checkBoxShopAsso_category'])) - foreach ($_POST['checkBoxShopAsso_category'] as $id_asso_object => $row) + if (Tools::isSubmit('checkBoxShopAsso_category')) + { + $check_box = Tools::getValue('checkBoxShopAsso_category'); + foreach ($check_box as $id_asso_object => $row) { foreach ($row as $id_shop => $value) $assos[] = array('id_object' => (int)$id_asso_object, 'id_shop' => (int)$id_shop); } + } foreach ($assos as $shop) $this->addPosition(Category::getLastPosition((int)$this->id_parent, $shop['id_shop']), $shop['id_shop']); } diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 71a63fc0c..8884a0a95 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2361,15 +2361,17 @@ class AdminControllerCore extends Controller return; $assos = array(); - if (isset($_POST['checkBox'.Tools::toCamelCase($type, true).'Asso_'.$table])) - foreach ($_POST['checkBox'.Tools::toCamelCase($type, true).'Asso_'.$table] as $id_asso_object => $row) + if (Tools::isSubmit('checkBox'.Tools::toCamelCase($type, true).'Asso_'.$table)) + { + $check_box = Tools::getValue('checkBox'.Tools::toCamelCase($type, true).'Asso_'.$table); + foreach ($check_box as $id_asso_object => $row) { if (!(int)$id_asso_object) $id_asso_object = $id_object; foreach ($row as $id_shop => $value) $assos[] = array('id_object' => (int)$id_asso_object, 'id_'.$type => (int)$id_shop); } - + } return array($assos, $type); }