mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
Debug v22
This commit is contained in:
@@ -259,7 +259,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "",
|
||||
* Scan a directory and return a list of files/directories.
|
||||
* Content for string is UTF8 and dir separator is "/".
|
||||
*
|
||||
* @param string $path Starting path from which to search. Example: 'produit/MYPROD' or 'produit/%'
|
||||
* @param string $path Starting path from which to search. Example: 'produit/MYPROD' or 'produit/%'. Must not end with "/".
|
||||
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @param string[]|null $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.'))
|
||||
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
|
||||
@@ -374,11 +374,11 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir, $object =
|
||||
$object = new stdClass();
|
||||
}
|
||||
|
||||
$filearrayindatabase = dol_dir_list_in_database(preg_replace('/[\\/]$/', '', $relativedir), '', null, 'name', SORT_ASC, 0, '', $object);
|
||||
$filearrayindatabase = dol_dir_list_in_database(rtrim($relativedir, "/\\"), '', null, 'name', SORT_ASC, 0, '', $object);
|
||||
|
||||
// TODO Remove this when PRODUCT_USE_OLD_PATH_FOR_PHOTO will be removed
|
||||
global $modulepart;
|
||||
if ($modulepart == 'produit' && getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
|
||||
// TODO Remove this when PRODUCT_USE_OLD_PATH_FOR_PHOTO will be removed
|
||||
global $object;
|
||||
if (!empty($object->id)) {
|
||||
if (isModEnabled("product")) {
|
||||
@@ -388,15 +388,14 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir, $object =
|
||||
}
|
||||
|
||||
$relativedirold = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $upload_dirold);
|
||||
$relativedirold = preg_replace('/^[\\/]/', '', $relativedirold);
|
||||
$relativedirold = ltrim($relativedirold, "/\\");
|
||||
|
||||
$filearrayindatabase = array_merge($filearrayindatabase, dol_dir_list_in_database($relativedirold, '', null, 'name', SORT_ASC));
|
||||
}
|
||||
} elseif ($modulepart == 'ticket') {
|
||||
foreach ($filearray as $key => $val) {
|
||||
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filearray[$key]['path']);
|
||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
|
||||
$rel_dir = trim($rel_dir, "/\\");
|
||||
if ($rel_dir != $relativedir) {
|
||||
$filearrayindatabase = array_merge($filearrayindatabase, dol_dir_list_in_database($rel_dir, '', null, 'name', SORT_ASC));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user