Merge pull request #24627 from frederic34/patch-2

Fix unknown variable in product.class.php
This commit is contained in:
Laurent Destailleur 2023-04-28 20:04:54 +02:00 committed by GitHub
commit d99483c034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,7 +572,7 @@ class Product extends CommonObject
*/
public function check()
{
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(stripslashes($this->ref));
@ -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));