diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php
index e19463934af..b49397220c2 100644
--- a/htdocs/admin/system/security.php
+++ b/htdocs/admin/system/security.php
@@ -272,7 +272,7 @@ print ' ';
if (file_exists($installlock)) { // If install not locked, no need to show this.
if (file_exists($upgradeunlock)) {
print ''.$langs->trans("DolibarrUpgrade").': ';
- print img_warning().' '.$langs->trans("UpgradeHasBeenUnlocked", $upgradeunlock);
+ print img_warning().' '.$langs->trans("WarningUpgradeHasBeenUnlocked", $upgradeunlock);
print ' ';
}
}
@@ -754,10 +754,10 @@ print 'WEBSITE_MAIN_SECURITY_FORCECSP = '.getDolGlobalString('W
print ' ('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\") ";
print ' ';
-print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\") ";
+print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined")."=\"strict-origin\" ".$langs->trans("or")." \"strict-origin-when-cross-origin\") ";
print ' ';
-print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('>WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').' ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\") ";
+print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').' ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\") ";
print ' ';
print 'WEBSITE_MAIN_SECURITY_FORCEPP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', ''.$langs->trans("Undefined").'').' ('.$langs->trans("Example").": \"camera: (); microphone: ();\") ";
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 47060b949f4..9ef1f4c94f4 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7330,7 +7330,7 @@ abstract class CommonObject
$isDependList = 1;
}
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
- $out .= '>'.$valb.'';
+ $out .= '>'.$langs->trans($valb).'';
}
$out .= '';
} elseif ($type == 'sellist') {
@@ -7954,7 +7954,7 @@ abstract class CommonObject
} elseif ($type == 'select') {
$value = isset($param['options'][$value]) ? $param['options'][$value] : '';
if (strpos($value, "|") !== false) {
- $value = explode('|', $value)[0];
+ $value = $langs->trans(explode('|', $value)[0]);
}
} elseif ($type == 'sellist') {
$param_list = array_keys($param['options']);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 29cb68f171d..40e93918771 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8014,22 +8014,22 @@ class Form
* Can use autocomplete with ajax after x key pressed or a full combo, depending on setup.
* This is the generic method that will replace all specific existing methods.
*
- * @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc.
- * @param string $htmlname Name of HTML select component
- * @param int $preselectedvalue Preselected value (ID of element)
- * @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
- * @param string $searchkey Search criteria
- * @param string $placeholder Place holder
- * @param string $morecss More CSS
- * @param string $moreparams More params provided to ajax call
- * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
- * @param int $disabled 1=Html component is disabled
- * @param string $selected_input_value Value of preselected input text (for use with ajax)
- * @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
+ * @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc.
+ * @param string $htmlname Name of HTML select component
+ * @param int $preSelectedValue Preselected value (ID of element)
+ * @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
+ * @param string $searchkey Search criteria
+ * @param string $placeholder Place holder
+ * @param string $morecss More CSS
+ * @param string $moreparams More params provided to ajax call
+ * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
+ * @param int $disabled 1=Html component is disabled
+ * @param string $selected_input_value Value of preselected input text (for use with ajax)
+ * @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
* @return string Return HTML string
* @see selectForFormsList(), select_thirdparty_list()
*/
- public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '')
+ public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '')
{
global $conf, $extrafields, $user;
@@ -8128,10 +8128,23 @@ class Form
if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) {
// No immediate load of all database
$placeholder = '';
- if ($preselectedvalue && empty($selected_input_value)) {
- $objecttmp->fetch($preselectedvalue);
+
+ if ($preSelectedValue && empty($selected_input_value)) {
+ $objecttmp->fetch($preSelectedValue);
$selected_input_value = ($prefixforautocompletemode == 'company' ? $objecttmp->name : $objecttmp->ref);
- //unset($objecttmp);
+
+ $oldValueForShowOnCombobox = 0;
+ foreach ($objecttmp->fields as $fieldK => $fielV) {
+ if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue;
+
+ if (!$oldValueForShowOnCombobox) {
+ $selected_input_value = '';
+ }
+
+ $selected_input_value .= $oldValueForShowOnCombobox ? ' - ' : '';
+ $selected_input_value .= $objecttmp->$fieldK;
+ $oldValueForShowOnCombobox = empty($fielV['showoncombobox']) ? 0 : $fielV['showoncombobox'];
+ }
}
// Set url and param to call to get json of the search results
@@ -8139,12 +8152,12 @@ class Form
$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
// Activate the auto complete using ajax call.
- $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array());
+ $out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
$out .= '';
$out .= '';
} else {
// Immediate load of table record.
- $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
+ $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
}
return $out;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6fe032f5456..0298ce0d439 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -9738,6 +9738,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
+ $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities
$forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index b4883e7f6f4..625cb2bfc51 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -343,6 +343,7 @@ WarningConfFileMustBeReadOnly=Warning, your config file (htdocs/conf/conf.php
WarningsOnXLines=Warnings on %s source record(s)
WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be chosen by default until you check your module setup.
WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable the installation/migration tools by adding a file install.lock into directory %s. Omitting the creation of this file is a grave security risk.
+WarningUpgradeHasBeenUnlocked=Warning, upgrade process has been unlocked for everybody
WarningUntilDirRemoved=This security warning will remain active as long as the vulnerability is present.
WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution.
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 548d2fb2099..44b62e8bb8f 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1669,9 +1669,9 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
// Referrer-Policy
// Say if we must provide the referrer when we jump onto another web page.
- // Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'same-origin' so browser doesn't send any referrer when going into another web site domain.
+ // Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'strict-origin' so browser doesn't send any referrer when going into another web site domain.
if (!defined('MAIN_SECURITY_FORCERP')) {
- $referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "same-origin");
+ $referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "strict-origin");
header("Referrer-Policy: ".$referrerpolicy);
}