Fix #yogosha4474

This commit is contained in:
Laurent Destailleur 2020-09-17 19:01:01 +02:00
parent 28fad93fb7
commit caaf0d370a

View File

@ -119,12 +119,12 @@ if (empty($reshook))
if ($action == 'add' && $user->rights->projet->creer)
{
$error = 0;
if (empty($_POST["ref"]))
if (! GETPOST('ref'))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors');
$error++;
}
if (empty($_POST["title"]))
if (! GETPOST('title'))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
$error++;
@ -148,13 +148,13 @@ if (empty($reshook))
$db->begin();
$object->ref = GETPOST('ref', 'alpha');
$object->title = GETPOST('title', 'none'); // Do not use 'alpha' here, we want field as it is
$object->ref = GETPOST('ref', 'alphanohtml');
$object->title = GETPOST('title', 'alphanohtml');
$object->socid = GETPOST('socid', 'int');
$object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public', 'alpha');
$object->opp_amount = price2num(GETPOST('opp_amount', 'alpha'));
$object->budget_amount = price2num(GETPOST('budget_amount', 'alpha'));
$object->public = GETPOST('public', 'alphanohtml');
$object->opp_amount = price2num(GETPOST('opp_amount', 'alphanohtml'));
$object->budget_amount = price2num(GETPOST('budget_amount', 'alphanohtml'));
$object->date_c = dol_now();
$object->date_start = $date_start;
$object->date_end = $date_end;