From a2f4671380ed28d15e5f9288dc789f0e331ef3c0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 7 Nov 2010 22:02:35 +0000 Subject: [PATCH] Fix: change _REQUEST with GETPOST for _COOKIE problem --- htdocs/categories/fiche.php | 34 +++++++++++++++++----------------- htdocs/categories/viewcat.php | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 4a4a5eb2a6e..b0b9245d7a4 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -33,31 +33,31 @@ $langs->load("categories"); // Security check -$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; +$socid=GETPOST('socid'); if (!$user->rights->categorie->lire) accessforbidden(); -if (isset ($_REQUEST['choix'])) +if (GETPOST('choix')) { - $nbcats = $_REQUEST['choix']; + $nbcats = GETPOST('choix'); } else { // par default, une nouvelle categorie sera dans une seule categorie mere $nbcats = 1; } -if ($_REQUEST['origin']) +if (GETPOST('origin')) { - if ($_GET['type'] == 0) $idProdOrigin = $_REQUEST['origin']; - if ($_GET['type'] == 1) $idSupplierOrigin = $_REQUEST['origin']; - if ($_GET['type'] == 2) $idCompanyOrigin = $_REQUEST['origin']; - if ($_GET['type'] == 3) $idMemberOrigin = $_REQUEST['origin']; + if ($_GET['type'] == 0) $idProdOrigin = GETPOST('origin'); + if ($_GET['type'] == 1) $idSupplierOrigin = GETPOST('origin'); + if ($_GET['type'] == 2) $idCompanyOrigin = GETPOST('origin'); + if ($_GET['type'] == 3) $idMemberOrigin = GETPOST('origin'); } -if ($_REQUEST['catorigin']) +if (GETPOST('catorigin')) { - if ($_GET['type'] == 0) $idCatOrigin = $_REQUEST['catorigin']; + if ($_GET['type'] == 0) $idCatOrigin = GETPOST('catorigin'); } -$urlfrom=isset($_REQUEST["urlfrom"])?$_REQUEST["urlfrom"]:''; +$urlfrom=GETPOST("urlfrom"); /* @@ -198,15 +198,15 @@ if ($user->rights->categorie->creer) print ''; print ''; print ''; - print ''; + print ''; print ''; - if ($_REQUEST['origin']) + if (GETPOST('origin')) { - print ''; + print ''; } - if ($_REQUEST['catorigin']) + if (GETPOST('catorigin')) { - print ''; + print ''; } print ''; @@ -235,7 +235,7 @@ if ($user->rights->categorie->creer) // Parent category print ''.$langs->trans ("AddIn").''; - print $html->select_all_categories($_GET['type'],$_REQUEST['catorigin']); + print $html->select_all_categories($_GET['type'],GETPOST('catorigin')); print ''; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 55f4d8a98e7..ce6f6b8a72b 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -37,14 +37,14 @@ if (! $user->rights->categorie->lire) $mesg = ''; -if ($_REQUEST['id'] == "") +if (GETPOST('id') == "") { dol_print_error('','Missing parameter id'); exit(); } $c = new Categorie($db); -$result=$c->fetch($_REQUEST['id']); +$result=$c->fetch(GETPOST('id')); if ($result <= 0) { dol_print_error($db,$c->error);