Fix remove some $_REQUEST

This commit is contained in:
Laurent Destailleur 2021-05-17 07:27:02 +02:00
parent 90d6f70bce
commit 6bf66adff0
9 changed files with 18 additions and 19 deletions

View File

@ -66,7 +66,7 @@ if ($action == 'updateform') {
} elseif ($action == 'delete') { } elseif ($action == 'delete') {
// Delete file // Delete file
$langs->load("other"); $langs->load("other");
$file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha');
$ret = dol_delete_file($file); $ret = dol_delete_file($file);
if ($ret) { if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs'); setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');

View File

@ -887,7 +887,6 @@ if ($resql) {
} }
if ($massaction == 'createbills') { if ($massaction == 'createbills') {
//var_dump($_REQUEST);
print '<input type="hidden" name="massaction" value="confirm_createbills">'; print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="noborder" width="100%" >'; print '<table class="noborder" width="100%" >';

View File

@ -829,7 +829,7 @@ if ($action == 'create') {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" name="formsoc">'; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" name="formsoc">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">'."\n\n"; print '<input type="hidden" name="id" value="'.GETPOST("id", 'int').'">'."\n\n";
print dol_get_fiche_head(array(), 0, '', 0); print dol_get_fiche_head(array(), 0, '', 0);

View File

@ -126,8 +126,8 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
@ -177,8 +177,8 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque-
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
@ -219,8 +219,8 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -316,8 +316,8 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if (empty($newlang)) { if (empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -58,8 +58,8 @@ if ($action == 'presend') {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -542,8 +542,8 @@ if ($action == 'create') { // Create. Seems to no be used
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if (empty($newlang)) { if (empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -687,8 +687,8 @@ if ($id > 0 || !empty($ref)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && !empty($_REQUEST['lang_id'])) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if (empty($newlang)) { if (empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;

View File

@ -1364,8 +1364,8 @@ if ($action == 'create' || $action == 'presend') {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = $_REQUEST['lang_id']; $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
$newlang = $object->default_lang; $newlang = $object->default_lang;