Update product.class.php

This commit is contained in:
Frédéric FRANCE 2023-04-27 20:12:39 +02:00 committed by GitHub
parent ef8f8d990a
commit ec964040e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -608,7 +608,7 @@ class Product extends CommonObject
$error = 0;
// Clean parameters
if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) {
if (getDolGlobalInt('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
$this->ref = trim($this->ref);
} else {
$this->ref = dol_sanitizeFileName(dol_string_nospecial(trim($this->ref)));
@ -702,7 +702,7 @@ class Product extends CommonObject
if (empty($this->ref) || $this->ref == 'auto') {
// Load object modCodeProduct
$module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
$module = getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON', 'mod_codeproduct_leopard');
if ($module != 'mod_codeproduct_leopard') { // Do not load module file for leopard
if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
@ -1008,7 +1008,7 @@ class Product extends CommonObject
}
// Clean parameters
if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) {
if (getDolGlobalInt('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
$this->ref = trim($this->ref);
} else {
$this->ref = dol_string_nospecial(trim($this->ref));