Skip to content

Commit

Permalink
Fix GETPOST
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 25, 2020
1 parent b7a0de1 commit ec10816
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/fourn/facture/card.php
Expand Up @@ -657,7 +657,7 @@
$_GET['socid'] = $_POST['socid'];
$error++;
}
if (!($_POST['fac_replacement'] > 0)) {
if (! (GETPOST('fac_replacement', 'int') > 0)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
}
Expand Down Expand Up @@ -870,7 +870,7 @@
if (!$error && $_POST['origin'] && $_POST['originid'])
{
// Parse element/subelement (ex: project_task)
$element = $subelement = GETPOST('origin');
$element = $subelement = GETPOST('origin', 'alpha');
/*if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs))
{
$element = $regs[1];
Expand All @@ -894,8 +894,8 @@
{
$element = 'projet';
}
$object->origin = GETPOST('origin');
$object->origin_id = GETPOST('originid');
$object->origin = GETPOST('origin', 'alpha');
$object->origin_id = GETPOST('originid', 'int');


require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php';
Expand Down

0 comments on commit ec10816

Please sign in to comment.