diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2e02f37ebec26..010f405e54940 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1820,7 +1820,7 @@ function init_repeat() $("#addreminder").prop("checked", true); // Set period with default reminder period - $("[name=\"offsetvalue\"]").val(\'' . dol_escape_js($reminderDefaultOffset) . '\'); + $("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset) . '\'); $("#select_offsetunittype_duration").select2("destroy"); $("#select_offsetunittype_duration").val(\''.dol_escape_js($reminderDefaultUnit).'\'); $("#select_offsetunittype_duration").select2(); @@ -1832,7 +1832,7 @@ function init_repeat() // Set default reminder mail model $("#select_actioncommsendmodel_mail").closest("tr").show(); $("#select_actioncommsendmodel_mail").select2("destroy"); - $("#select_actioncommsendmodel_mail").val(\''.dol_escape_js($reminderDefaultEmailModel).'\'); + $("#select_actioncommsendmodel_mail").val(\''.dol_escape_js((string) $reminderDefaultEmailModel).'\'); $("#select_actioncommsendmodel_mail").select2(); } }); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0a97ee8f40704..082639332beb0 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -484,6 +484,10 @@ public function create($user, $notrigger = 0) $error = 0; $now = dol_now(); + if (empty($this->date_creation)) { + $this->date_creation = $now; + } + $this->db->begin(); // Clean parameters diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 28422a2d77f6c..74696c589662e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -10333,6 +10333,7 @@ public function createCommon(User $user, $notrigger = 0) if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) { $fieldvalues['date_creation'] = $this->db->idate($now); + $this->date_creation = $this->db->idate($now); } if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bb482bbf43313..555778e7124b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2237,7 +2237,11 @@ public function select_dolusers($selected = '', $htmlname = 'userid', $show_empt if ($errormessage) { $this->errors[] = $errormessage; dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); - return -1; + if ($outputmode == 0) { + return 'Error bad param $morefilter'; + } else { + return array(); + } } } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 78a5e6a002947..0323e67265ada 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -796,7 +796,7 @@ function checkPHPCode(&$phpfullcodestringold, &$phpfullcodestring) if (!$error) { if (preg_match('/\*\/\s*\(/ims', $phpfullcodestring)) { $error++; - setEventMessages($langs->trans("DynamicPHPCodeContainsAForbiddenInstruction", $forbiddenphpmethod), null, 'errors'); + setEventMessages($langs->trans("DynamicPHPCodeContainsAForbiddenInstruction", "exec/*...*/ ('ls')"), null, 'errors'); } } diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 54c2238adfa0c..7b9029cf6b819 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -282,11 +282,12 @@
"> +file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
- + " name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" /> @@ -294,7 +295,6 @@
-file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
array_import_label[$key]; print '
'; print img_object($objimport->array_import_module[$key]['module']->getName(), $entityicon, 'class="pictofixedwidth"'); - print dolPrintHtml($label); + print dolPrintHTML($label); print '
'; print ''; if ($objimport->array_import_perms[$key]) { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index cd06cb211efcf..ac31dc344dd24 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -284,7 +284,9 @@ public function create(User $user, $notrigger = 0) { $resultcreate = $this->createCommon($user, $notrigger); - //$resultvalidate = $this->validate($user, $notrigger); + // uncomment lines below if you want to validate object after creation + // $this->fetch($this->id); // needed to retrieve some fields (ie date_creation for masked ref) + // $resultcreate = $this->validate($user, $notrigger); return $resultcreate; }