mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
FIX broken feature, entity can not be empty !
This commit is contained in:
@@ -2747,12 +2747,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
if (empty($modulepart)) {
|
||||
return 'ErrorBadParameter';
|
||||
}
|
||||
// entity can't be empty
|
||||
if (empty($entity)) {
|
||||
if (!isModEnabled('multicompany')) {
|
||||
$entity = 1;
|
||||
} else {
|
||||
$entity = 0;
|
||||
}
|
||||
$entity = $conf->entity;
|
||||
}
|
||||
// Fix modulepart for backward compatibility
|
||||
if ($modulepart == 'facture') {
|
||||
@@ -2803,9 +2800,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
if (isModEnabled('multicompany') && (empty($entity) || empty($conf->medias->multidir_output[$entity]))) {
|
||||
return array('accessallowed' => 0, 'error' => 'Value entity must be provided');
|
||||
} */
|
||||
if (empty($entity)) {
|
||||
$entity = 1;
|
||||
}
|
||||
$accessallowed = 1;
|
||||
$original_file = (empty($conf->medias->multidir_output[$entity]) ? $conf->medias->dir_output : $conf->medias->multidir_output[$entity]).'/'.$original_file;
|
||||
} elseif ($modulepart == 'logs' && !empty($dolibarr_main_data_root)) {
|
||||
|
||||
Reference in New Issue
Block a user