mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX edit contract of intervention broken by CSRF protection
This commit is contained in:
parent
e8c45ace3b
commit
336b723ab8
|
|
@ -293,7 +293,7 @@ class Form
|
|||
// So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwyg is off.
|
||||
$valuetoshow = str_replace('&', '&', $valuetoshow);
|
||||
$ret .= dol_htmlwithnojs(dol_string_neverthesehtmltags($valuetoshow, array('textarea')));
|
||||
$ret .= '</textarea>';
|
||||
$ret .= '</textarea><div class="clearboth"></div>';
|
||||
} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
|
||||
$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
|
||||
$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
|
||||
|
|
|
|||
|
|
@ -1367,14 +1367,14 @@ if ($action == 'create') {
|
|||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('Contract');
|
||||
print '</td>';
|
||||
if ($action != 'contrat') {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
if ($action != 'editcontract') {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editcontract&id='.$object->id.'">';
|
||||
print img_edit($langs->trans('SetContract'), 1);
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'contrat') {
|
||||
if ($action == 'editcontract') {
|
||||
$formcontract = new FormContract($db);
|
||||
$formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1, 1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
$sensitiveget = false;
|
||||
if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
|
||||
// All GET actions (except the listed exceptions that are usually post for pre-actions and not real action) and mass actions are processed as sensitive.
|
||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'reconcile', 'specimen'))) { // We exclude some action that are not sensitive so legitimate
|
||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editcontract', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'reconcile', 'specimen'))) { // We exclude some action that are not sensitive so legitimate
|
||||
$sensitiveget = true;
|
||||
}
|
||||
} elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user