forked from Wavyzz/dolibarr
Prepare fix to hide images generated by "preview" feature.
This commit is contained in:
@@ -43,7 +43,7 @@ function dol_basename($pathfile)
|
||||
* @param string $types Can be "directories", "files", or "all"
|
||||
* @param int $recursive Determines whether subdirectories are searched
|
||||
* @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[] $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.'))
|
||||
* @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.'))
|
||||
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
|
||||
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
|
||||
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
|
||||
@@ -1281,11 +1281,11 @@ function dol_uncompress($inputfile,$outputdir)
|
||||
*
|
||||
* @param string $dir Directory to scan
|
||||
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @param string[] $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @param int $nohook Disable all hooks
|
||||
* @return string Full path to most recent file
|
||||
*/
|
||||
function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$','^\.'),$nohook=false)
|
||||
function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta|_preview\.png)$','^\.'),$nohook=false)
|
||||
{
|
||||
$tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,'',$nohook);
|
||||
return $tmparray[0];
|
||||
|
||||
Reference in New Issue
Block a user