mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix regression in website module to get javascript files
This commit is contained in:
@@ -157,7 +157,8 @@ $type = 'application/octet-stream'; // By default
|
||||
if (GETPOST('type', 'alpha')) $type = GETPOST('type', 'alpha');
|
||||
else $type = dol_mimetype($original_file);
|
||||
// Security: Force to octet-stream if file is a dangerous file. For example when it is a .noexe file
|
||||
if (!dolIsAllowedForPreview($original_file)) {
|
||||
// We do not force if file is a javascript to be able to get js from website module with <script src="
|
||||
if (! in_array($type, array('text/x-javascript')) && !dolIsAllowedForPreview($original_file)) {
|
||||
$type = 'application/octet-stream';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user