forked from Wavyzz/dolibarr
Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -2634,7 +2634,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(
|
||||
* @param string $original_file Relative path with filename, relative to modulepart.
|
||||
* @param string $entity Restrict onto entity (0=no restriction)
|
||||
* @param User|null $fuser User object (forced)
|
||||
* @param string $refname Ref of object to check permission for external users (autodetect if not provided) or for hierarchy
|
||||
* @param string $refname Ref of object to check permission for external users (autodetect if not provided by taking the dirname of $original_file) or for hierarchy
|
||||
* @param string $mode Check permission for 'read' or 'write'
|
||||
* @return mixed Array with access information : 'accessallowed' & 'sqlprotectagainstexternals' & 'original_file' (as a full path name)
|
||||
* @see restrictedArea()
|
||||
@@ -2682,7 +2682,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
// Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10'
|
||||
if (empty($refname)) {
|
||||
$refname = basename(dirname($original_file)."/");
|
||||
if ($refname == 'thumbs') {
|
||||
if ($refname == 'thumbs' || $refname == 'temp') {
|
||||
// If we get the thumbs directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10'
|
||||
$refname = basename(dirname(dirname($original_file))."/");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user