2
0
forked from Wavyzz/dolibarr

Fix to show path file without will path (security)

This commit is contained in:
Laurent Destailleur
2023-05-13 14:29:40 +02:00
parent 02c2953036
commit cd5ee6005f

View File

@@ -3229,6 +3229,17 @@ function dol_readcachefile($directory, $filename)
return $object;
}
/**
* Return the relative dirname (relative to DOL_DATA_ROOT) of a full path string.
*
* @param string $pathfile Full path of a file
* @return string Path of file relative to DOL_DATA_ROOT
*/
function dirbasename($pathfile)
{
return preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'\//', '', $pathfile);
}
/**
* Function to get list of updated or modified files.