diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19c5ce79c82..4be2583aa63 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -170,7 +170,7 @@ function dol_shutdown() * Return value of a param into GET or POST supervariable * * @param string $paramname Name of parameter to found - * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options) + * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to custom diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 3dc6ea95900..a0b9bda1c8e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -136,48 +136,48 @@ if (empty($reshook)) { $object->particulier = GETPOST("private"); - $object->name = dolGetFirstLastname(GETPOST('firstname','san_alpha'),GETPOST('nom','san_alpha')?GETPOST('nom','san_alpha'):GETPOST('name','san_alpha')); + $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha')); $object->civility_id = GETPOST('civility_id', 'int'); // Add non official properties - $object->name_bis = GETPOST('name','san_alpha')?GETPOST('name','san_alpha'):GETPOST('nom','san_alpha'); - $object->firstname = GETPOST('firstname','san_alpha'); + $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha'); + $object->firstname = GETPOST('firstname','alpha'); } else { - $object->name = GETPOST('name', 'san_alpha')?GETPOST('name', 'san_alpha'):GETPOST('nom', 'san_alpha'); + $object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha'); } - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id', 'int'); $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax','san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax','alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); - $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); - $object->code_client = GETPOST('code_client', 'san_alpha'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->capital = GETPOST('capital', 'san_alpha'); - $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->capital = GETPOST('capital', 'alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); - $object->tva_assuj = GETPOST('assujtva_value', 'san_alpha'); - $object->status = GETPOST('status', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); + $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); + $object->status = GETPOST('status', 'alpha'); // Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'san_alpha'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'san_alpha'); + $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha'); + $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha'); - $object->localtax1_value = GETPOST('lt1', 'san_alpha'); - $object->localtax2_value = GETPOST('lt2', 'san_alpha'); + $object->localtax1_value = GETPOST('lt1', 'alpha'); + $object->localtax2_value = GETPOST('lt2', 'alpha'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); @@ -637,31 +637,31 @@ else if (GETPOST("type")=='p') { $object->client=2; } if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } - $object->name = GETPOST('nom', 'san_alpha'); - $object->firstname = GETPOST('firstname', 'san_alpha'); + $object->name = GETPOST('nom', 'alpha'); + $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm'); $object->client = GETPOST('client')?GETPOST('client'):$object->client; - $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax', 'san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'int'); - $object->barcode = GETPOST('barcode', 'san_alpha'); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); $object->typent_id = GETPOST('typent_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); $object->civility_id = GETPOST('civility_id', 'int'); @@ -676,7 +676,7 @@ else $object->localtax1_value =GETPOST('lt1', 'int'); $object->localtax2_value =GETPOST('lt2', 'int'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); @@ -1146,37 +1146,37 @@ else if (GETPOST('nom')) { // We overwrite with values if posted - $object->name = GETPOST('nom', 'san_alpha'); - $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); + $object->name = GETPOST('nom', 'alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->client = GETPOST('client', 'int'); - $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id; $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax', 'san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'int'); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); $object->typent_id = GETPOST('typent_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); - $object->default_lang = GETPOST('default_lang', 'san_alpha'); + $object->default_lang = GETPOST('default_lang', 'alpha'); $object->tva_assuj = GETPOST('assujtva_value', 'int'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->status = GETPOST('status', 'int'); //Local Taxes