mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX #yogosha8628
This commit is contained in:
parent
f99e19e729
commit
5249840402
|
|
@ -9236,7 +9236,7 @@ function dolIsAllowedForPreview($file)
|
|||
|
||||
|
||||
/**
|
||||
* Return mime type of a file
|
||||
* Return MIME type of a file from its name with extension.
|
||||
*
|
||||
* @param string $file Filename we looking for MIME type
|
||||
* @param string $default Default mime type if extension not found in known list
|
||||
|
|
|
|||
|
|
@ -229,6 +229,11 @@ $original_file = str_replace('..\\', '/', $original_file);
|
|||
// Find the subdirectory name as the reference
|
||||
$refname = basename(dirname($original_file)."/");
|
||||
|
||||
// Check that file is allowed for view with viewimage.php
|
||||
if (!dolIsAllowedForPreview($original_file)) {
|
||||
accessforbidden('This file is not qualified for preview', 0, 0, 1);
|
||||
}
|
||||
|
||||
// Security check
|
||||
if (empty($modulepart)) {
|
||||
accessforbidden('Bad value for parameter modulepart', 0, 0, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user