2
0
forked from Wavyzz/dolibarr

Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and

not recommanded to use in Dolibarr.
This commit is contained in:
Laurent Destailleur
2019-04-08 14:55:31 +02:00
parent 1b415a6aed
commit 917b9d69fa
6 changed files with 6 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ Following changes may create regressions for some external modules, but were nec
* Method dolEscapeXML was moved from functions.lib.php into function2.lib.php (not used enough to be loaded by default). * Method dolEscapeXML was moved from functions.lib.php into function2.lib.php (not used enough to be loaded by default).
* Removed deprecated use of string in dol_print_date(). Only date allowed. * Removed deprecated use of string in dol_print_date(). Only date allowed.
* Deprecated property ->fk_departement is now ->state_id everywhere. * Deprecated property ->fk_departement is now ->state_id everywhere.
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
***** ChangeLog for 9.0.2 compared to 9.0.1 ***** ***** ChangeLog for 9.0.2 compared to 9.0.1 *****

View File

@@ -282,7 +282,7 @@ if ($mode == 'customer')
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled") Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
); );
print $form->selectarray('object_status', $liststatus, GETPOST('object_status'), -4); print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4);
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {

View File

@@ -226,7 +226,7 @@ function GETPOSTISSET($paramname)
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) * 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
* 'nohtml', 'alphanohtml'=check there is no html content * 'nohtml', 'alphanohtml'=check there is no html content
* 'custom'= custom filter specify $filter and $options) * '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 $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
* @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 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' * @param mixed $options Options to pass to filter_var when $check is set to 'custom'
* @param string $noreplace Force disable of replacement of __xxx__ strings. * @param string $noreplace Force disable of replacement of __xxx__ strings.
@@ -248,7 +248,6 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:'';
elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:''; elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:'';
elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:''); elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:'');
elseif ($method==4) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:(isset($_COOKIE[$paramname])?$_COOKIE[$paramname]:''));
else return 'BadThirdParameterForGETPOST'; else return 'BadThirdParameterForGETPOST';
if (empty($method) || $method == 3 || $method == 4) if (empty($method) || $method == 3 || $method == 4)

View File

@@ -234,7 +234,7 @@ print '</td></tr>';
// Status // Status
print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">'; print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">';
$liststatus=$tmpexpensereport->statuts; $liststatus=$tmpexpensereport->statuts;
print $form->selectarray('object_status', $liststatus, GETPOST('object_status'), -4, 0, 0, '', 1); print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4, 0, 0, '', 1);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';

View File

@@ -80,7 +80,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
} }
} }
$nom=substr(GETPOST("nom"), 0, 64); $nom=substr(GETPOST("nom", 'nohtml'), 0, 64);
// Check if vote already exists // Check if vote already exists
$sql = 'SELECT id_users, nom as name'; $sql = 'SELECT id_users, nom as name';

View File

@@ -251,7 +251,7 @@ $liststatus=array(
Ticket::STATUS_CLOSED=>$langs->trans("StatusClosed"), Ticket::STATUS_CLOSED=>$langs->trans("StatusClosed"),
Ticket::STATUS_WAITING=>$langs->trans("StatusWaiting") Ticket::STATUS_WAITING=>$langs->trans("StatusWaiting")
); );
print $form->selectarray('object_status', $liststatus, GETPOST('object_status'), -4); print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td class="left">'.$langs->trans("Year").'</td><td class="left">'; print '<tr><td class="left">'.$langs->trans("Year").'</td><td class="left">';