diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 4fafb8a19aa..ef105b6709a 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -292,7 +292,7 @@ if ($action == 'setjournal') { } if ($action == 'setdocref') { - $refdoc = trim(GETPOST('doc_ref', 'alpha')); + $refdoc = GETPOST('doc_ref', 'alpha'); $result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 53110b9cad8..94632dc0184 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -108,7 +108,7 @@ if ($actionsave) // Save colors while ($i <= 2) { - $color = trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha')); + $color = GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha'); if ($color == '-1') $color = ''; $res = dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index fb08286e0a3..0c74b19b424 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -62,7 +62,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index a9db23a062a..ef00ece52fc 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -86,7 +86,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'emailcollector', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 89f9e23fdca..2de3c436826 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -80,7 +80,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'mymodule', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 85e3b2b2e5c..e8b60eba5fb 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -33,7 +33,7 @@ $langs->load("admin"); $action = GETPOST('action', 'alpha'); $what = GETPOST('what', 'alpha'); $export_type = GETPOST('export_type', 'alpha'); -$file = trim(GETPOST('zipfilename_template', 'alpha')); +$file = GETPOST('zipfilename_template', 'alpha'); $compression = GETPOST('compression'); $file = dol_sanitizeFileName($file); diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 540de545baf..8606751ba85 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -53,7 +53,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 549e2fc0d25..ab31c6c9831 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -81,7 +81,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'asset', $id,''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 6826204804f..0f28f65912a 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -57,7 +57,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 3ff2b2138b4..6092f11aea5 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -81,7 +81,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'bom', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6d9bb13e2c1..03cb85a6f59 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -250,8 +250,8 @@ if (empty($reshook) && $action == 'add') // Initialisation objet actioncomm $object->priority = GETPOST("priority") ? GETPOST("priority") : 0; $object->fulldayevent = (!empty($fulldayevent) ? 1 : 0); - $object->location = GETPOST("location"); - $object->label = trim(GETPOST('label')); + $object->location = GETPOST("location", 'alphanohtml'); + $object->label = GETPOST('label', 'alphanohtml'); $object->fk_element = GETPOST("fk_element", 'int'); $object->elementtype = GETPOST("elementtype", 'alpha'); if (!GETPOST('label')) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6710ac56b58..619203c4dca 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -78,7 +78,7 @@ $search_login = GETPOST('search_login', 'alpha'); $search_product_category = GETPOST('search_product_category', 'int'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); @@ -88,7 +88,7 @@ $search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int')); $search_availability = GETPOST('search_availability', 'int'); -$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); +$search_categ_cus = GETPOST("search_categ_cus", 'int'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index cb63f14ab63..637d6a71899 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -65,7 +65,7 @@ $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); @@ -82,7 +82,7 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); -$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); +$search_categ_cus = GETPOST("search_categ_cus", 'int'); $optioncss = GETPOST('optioncss', 'alpha'); $billed = GETPOST('billed', 'int'); $search_status = GETPOST('search_status', 'int'); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 0af1f84d9f6..fb4c2150495 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -217,7 +217,7 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' $error = 0; // Definition, nettoyage parametres - $num_releve = trim(GETPOST("num_releve", "alpha")); + $num_releve = GETPOST("num_releve", "alpha"); if ($num_releve) { diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 0279ad5143c..d24c4ac1059 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -98,7 +98,7 @@ if ($user->socid > 0) // Protection if external user //$result = restrictedArea($user, 'monmodule', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 461706edee7..a09a8b6e6dd 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -100,7 +100,7 @@ $search_module_source = GETPOST('search_module_source', 'alpha'); $search_pos_source = GETPOST('search_pos_source', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_user = GETPOST('search_user', 'int'); @@ -111,7 +111,7 @@ $search_date_valid_start = dol_mktime(0, 0, 0, GETPOST('search_date_valid_startm $search_date_valid_end = dol_mktime(23, 59, 59, GETPOST('search_date_valid_endmonth', 'int'), GETPOST('search_date_valid_endday', 'int'), GETPOST('search_date_valid_endyear', 'int')); $search_datelimit_start = dol_mktime(0, 0, 0, GETPOST('search_datelimit_startmonth', 'int'), GETPOST('search_datelimit_startday', 'int'), GETPOST('search_datelimit_startyear', 'int')); $search_datelimit_end = dol_mktime(23, 59, 59, GETPOST('search_datelimit_endmonth', 'int'), GETPOST('search_datelimit_endday', 'int'), GETPOST('search_datelimit_endyear', 'int')); -$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); +$search_categ_cus = GETPOST("search_categ_cus", 'int'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 4eea16f706b..4390c9c1cb0 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -107,7 +107,7 @@ if (empty($reshook)) if (substr($key, 0, 7) == 'amount_' && GETPOST($key) != '') { $cursorfacid = substr($key, 7); - $amounts[$cursorfacid] = price2num(trim(GETPOST($key))); + $amounts[$cursorfacid] = price2num(GETPOST($key)); $totalpayment = $totalpayment + $amounts[$cursorfacid]; if (!empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++; $result = $tmpinvoice->fetch($cursorfacid); @@ -134,7 +134,7 @@ if (empty($reshook)) } elseif (substr($key, 0, 21) == 'multicurrency_amount_') { $cursorfacid = substr($key, 21); - $multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key))); + $multicurrency_amounts[$cursorfacid] = price2num(GETPOST($key)); $multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid]; if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++; $result = $tmpinvoice->fetch($cursorfacid); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 53934deaac1..c6c0f24497a 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -47,7 +47,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $type = GETPOST('type', 'aZ09'); $search_facture = GETPOST('search_facture', 'alpha'); -$search_societe = trim(GETPOST('search_societe', 'alpha')); +$search_societe = GETPOST('search_societe', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9eeae17280f..cb81d30798a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -62,7 +62,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars $search_phone = GETPOST("search_phone", 'alpha'); -$search_id = trim(GETPOST("search_id", "int")); +$search_id = GETPOST("search_id", "int"); $search_firstlast_only = GETPOST("search_firstlast_only", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); $search_firstname = GETPOST("search_firstname", 'alpha'); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8afc2f0e335..e15d6467755 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -50,13 +50,13 @@ $search_name = GETPOST('search_name', 'alpha'); $search_email = GETPOST('search_email', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state", 'alpha')); +$search_state = GETPOST("search_state", 'alpha'); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_contract = GETPOST('search_contract', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search_status = GETPOST('search_status', 'alpha'); $socid = GETPOST('socid', 'int'); $search_user = GETPOST('search_user', 'int'); diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index 55a205bffd8..90b7afc717a 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -44,7 +44,7 @@ if (!empty($actionsave)) $db->begin(); - $i += dolibarr_set_const($db, 'CRON_KEY', trim(GETPOST("CRON_KEY")), 'chaine', 0, '', 0); + $i += dolibarr_set_const($db, 'CRON_KEY', GETPOST("CRON_KEY"), 'chaine', 0, '', 0); if ($i >= 1) { diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index e17892097af..b4e3c76aef1 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -120,9 +120,9 @@ if ($action == 'add' && $permtoadd) } } - $ref = trim(GETPOST("ref", 'alpha')); - $label = trim(GETPOST("label", 'alpha')); - $desc = trim(GETPOST("desc", 'alpha')); + $ref = GETPOST("ref", 'alpha'); + $label = GETPOST("label", 'alpha'); + $desc = GETPOST("desc", 'alpha'); $catParent = GETPOST("catParent", 'alpha'); // Can be an int (with ECM) or a string (with generic filemanager) if ($catParent == '-1') $catParent = 0; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index b28bc7d062c..5c94ff3da95 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -59,7 +59,7 @@ $search_company = GETPOST("search_company", 'alpha'); $search_tracking = GETPOST("search_tracking", 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_billed = GETPOST("search_billed", 'int'); @@ -71,7 +71,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', $socid = GETPOST('socid', 'int'); $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); -$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); +$search_categ_cus = GETPOST("search_categ_cus", 'int'); $search_product_category = GETPOST('search_product_category', 'int'); $optioncss = GETPOST('optioncss', 'alpha'); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index a792d68fc6b..ea2e44b775d 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -66,7 +66,7 @@ $search_refsupp = GETPOST('search_refsupp', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state", 'alpha')); +$search_state = GETPOST("search_state", 'alpha'); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_user = GETPOST('search_user', 'int'); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 16fffbcbea4..655798deac7 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -94,7 +94,7 @@ $search_status = GETPOST('search_status', 'int'); $search_paymentmode = GETPOST('search_paymentmode', 'int'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_user = GETPOST('search_user', 'int'); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index db5bc9acfb5..1cddb2e74da 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -138,7 +138,7 @@ if (empty($reshook)) if (substr($key, 0, 7) == 'amount_') { $cursorfacid = substr($key, 7); - $amounts[$cursorfacid] = price2num(trim(GETPOST($key))); + $amounts[$cursorfacid] = price2num(GETPOST($key)); if (!empty($amounts[$cursorfacid])) { $atleastonepaymentnotnull++; if (is_numeric($amounts[$cursorfacid])) { @@ -171,7 +171,7 @@ if (empty($reshook)) } elseif (substr($key, 0, 21) == 'multicurrency_amount_') { $cursorfacid = substr($key, 21); - $multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key))); + $multicurrency_amounts[$cursorfacid] = price2num(GETPOST($key)); $multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid]; if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++; $result = $tmpinvoice->fetch($cursorfacid); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index fe315f9c7b7..b4f168fd7ff 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -144,7 +144,7 @@ if (empty($reshook)) elseif ($endhalfday == 'morning') $halfday = 1; $valideur = GETPOST('valideur', 'int'); - $description = trim(GETPOST('description')); + $description = trim(GETPOST('description', 'none')); // If no type if ($type <= 0) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index dfa79e499bc..1fcfabbe7c6 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -89,7 +89,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 2dfa672acbf..bd737aa2336 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea if (!$sortorder) $sortorder = "ASC"; // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml')); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index c570678a7c9..19ec10daf3b 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -79,7 +79,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 64441a4fec9..14d5c673f1a 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -107,7 +107,7 @@ if ($user->socid > 0) // Protection if external user // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml')); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 6a680153c57..a5503147f0c 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -83,7 +83,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index c14bfaf5e74..85cd3464c1f 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -320,7 +320,7 @@ class ActionsCardProduct if ($field['enabled']) { $fieldname = "s".$field['alias']; - $$fieldname = trim(GETPOST($fieldname)); + $$fieldname = GETPOST($fieldname); } } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 6a2406d74b5..2e662608e98 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -59,7 +59,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2105435badf..d9a5e081496 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -64,7 +64,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 4d451fcbeec..851c37ed258 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -81,7 +81,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index e5fb6509c4d..c64edfac4bb 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -97,7 +97,7 @@ $fieldstosearchall = array( ); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 93aba12eb00..53b15dacb70 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -53,7 +53,7 @@ $search_ref_supplier = GETPOST('search_ref_supplier'); $search_company = GETPOST("search_company"); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_billed = GETPOST("search_billed", 'int'); diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 2cde35c85e6..e93a84c5a22 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -88,7 +88,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 8cf1bc9dc61..2bc5ce3e015 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea if (!$sortorder) $sortorder = "ASC"; // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml')); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/recruitment/recruitmentjobposition_candidature.php b/htdocs/recruitment/recruitmentjobposition_candidature.php index d0e15827c2e..804aca26af4 100644 --- a/htdocs/recruitment/recruitmentjobposition_candidature.php +++ b/htdocs/recruitment/recruitmentjobposition_candidature.php @@ -89,7 +89,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 0763b5ca749..bdc1fe24742 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -89,7 +89,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index d97d4909ea8..38657db557b 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea if (!$sortorder) $sortorder = "ASC"; // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml')); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index e7ebae374e2..5347cbe32e3 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -76,7 +76,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($objectwebsiteaccount unset($objectwebsiteaccount->fields['fk_soc']); // Remove this field, we are already on the thirdparty // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($objectwebsiteaccount->fields as $key => $val) { diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index d0ea3a2b625..008a81542ec 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -62,7 +62,7 @@ $search_societe = GETPOST('search_societe', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); -$search_state = trim(GETPOST("search_state")); +$search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 437df1981ba..d5da98b4a84 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -78,7 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { @@ -471,7 +471,7 @@ if (empty($reshook)) { if ($action == 'setsubject') { if ($object->fetch(GETPOST('id', 'int'))) { if ($action == 'setsubject') { - $object->subject = trim(GETPOST('subject', 'alphanohtml')); + $object->subject = GETPOST('subject', 'alphanohtml'); } if ($action == 'setsubject' && empty($object->subject)) { diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index f325b706410..d6d3fdcc4a1 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -129,7 +129,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NameNotDefined"), null, 'errors'); $action = "create"; // Go back to create page } else { - $object->name = trim(GETPOST("nom", 'nohtml')); + $object->name = GETPOST("nom", 'nohtml'); //$object->nom = $object->name; // For backward compatibility $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none'))); @@ -204,7 +204,7 @@ if (empty($reshook)) { $object->oldcopy = clone $object; - $object->name = trim(GETPOST("nom", 'nohtml')); + $object->name = GETPOST("nom", 'nohtml'); //$object->nom = $object->name; // For backward compatibility $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none'))); diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 8baae98e6ef..74512718cb3 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -45,8 +45,8 @@ $action = GETPOST('action', 'alpha'); $mode = $dolibarr_main_authentication; if (!$mode) $mode = 'http'; -$username = trim(GETPOST('username', 'alpha')); -$passwordhash = trim(GETPOST('passwordhash', 'alpha')); +$username = GETPOST('username', 'alpha'); +$passwordhash = GETPOST('passwordhash', 'alpha'); $conf->entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : 1); // Instantiate hooks of thirdparty module only if not already define diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index cb0940bb61c..9017aa40815 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -41,7 +41,7 @@ if ($actionsave) $db->begin(); - $i += dolibarr_set_const($db, 'WEBSERVICES_KEY', trim(GETPOST("WEBSERVICES_KEY")), 'chaine', 0, '', $conf->entity); + $i += dolibarr_set_const($db, 'WEBSERVICES_KEY', GETPOST("WEBSERVICES_KEY"), 'chaine', 0, '', $conf->entity); if ($i >= 1) { diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 54accb48fd3..8494cfb9ae7 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -51,7 +51,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index c6cfda9f539..6c098999d58 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -53,7 +53,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php index 228d26232e8..8b2a8d70bc4 100644 --- a/htdocs/zapier/hook_list.php +++ b/htdocs/zapier/hook_list.php @@ -93,7 +93,7 @@ if ($user->socid > 0) { //$result = restrictedArea($user, 'mymodule', $id, ''); // Initialize array of search criterias -$search_all = trim(GETPOST("search_all", 'alpha')); +$search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');