FIX #16107
This commit is contained in:
parent
1063b97c22
commit
ca7738c9b3
@ -425,7 +425,7 @@ class Documents extends DolibarrApi
|
||||
throw new RestException(500, 'Error while fetching object: '.$object->error);
|
||||
}
|
||||
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
|
||||
}
|
||||
elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||
{
|
||||
|
||||
@ -5652,7 +5652,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
||||
$arrayforoldpath = array('cheque', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment');
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[] = 'product';
|
||||
if (!empty($level) && in_array($modulepart, $arrayforoldpath)) {
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided.
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with parameter $object and $modulepart provided.
|
||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i', '', $num);
|
||||
else $num = preg_replace('/^.*\-/i', '', $num);
|
||||
$num = substr("000".$num, -$level);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user