Debug v21

This commit is contained in:
Laurent Destailleur (aka Eldy) 2025-02-04 17:20:42 +01:00
parent 66dc3e810a
commit 41dd4e884e
2 changed files with 4 additions and 4 deletions

View file

@ -300,7 +300,7 @@ if ($type == 'directory') {
// Automatic list
if (in_array($module, $automodules)) {
$param .= '&module='.$module;
$param .= '&module='.urlencode($module);
if (isset($search_doc_ref) && $search_doc_ref != '') {
$param .= '&search_doc_ref='.urlencode($search_doc_ref);
}

View file

@ -250,7 +250,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'
* @param string $path Starting path from which to search. Example: 'produit/MYPROD' or 'produit/%'
* @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")
@ -272,9 +272,9 @@ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $s
$sql .= ", description";
}
$sql .= " FROM ".MAIN_DB_PREFIX."ecm_files";
$sql .= " WHERE entity = ".$conf->entity;
$sql .= " WHERE entity = ".((int) $conf->entity);
if (preg_match('/%$/', $path)) {
$sql .= " AND filepath LIKE '".$db->escape($path)."'";
$sql .= " AND (filepath LIKE '".$db->escape($path)."' OR filepath = '".$db->escape(preg_replace('/\/%$/', '', $path))."')";
} else {
$sql .= " AND filepath = '".$db->escape($path)."'";
}