Fix error
This commit is contained in:
parent
5a6d2b2755
commit
949a16b892
@ -156,12 +156,13 @@ if (isset($_GET["attachment"])) $attachment = GETPOST("attachment", 'alpha')?tru
|
|||||||
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
|
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
|
||||||
|
|
||||||
// Define mime type
|
// Define mime type
|
||||||
$type = 'application/octet-stream';
|
$type = 'application/octet-stream'; // By default
|
||||||
if (GETPOST('type', 'alpha')) $type=GETPOST('type', 'alpha');
|
if (GETPOST('type', 'alpha')) $type=GETPOST('type', 'alpha');
|
||||||
else $type=dol_mimetype($original_file);
|
else $type=dol_mimetype($original_file);
|
||||||
// Security: Force to octet-stream if file is a dangerous file
|
// Security: Force to octet-stream if file is a dangerous file. For example when it is a .noexe file
|
||||||
if (preg_match('/\.noexe$/i', $original_file)) $type = 'application/octet-stream';
|
if (!dolIsAllowedForPreview($original_file)) {
|
||||||
|
$type = 'application/octet-stream';
|
||||||
|
}
|
||||||
// Security: Delete string ../ into $original_file
|
// Security: Delete string ../ into $original_file
|
||||||
$original_file = str_replace("../", "/", $original_file);
|
$original_file = str_replace("../", "/", $original_file);
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,7 @@ if ($action == 'update')
|
|||||||
|
|
||||||
$oldlabel=GETPOST('urlfile', 'alpha');
|
$oldlabel=GETPOST('urlfile', 'alpha');
|
||||||
$newlabel=GETPOST('label', 'alpha');
|
$newlabel=GETPOST('label', 'alpha');
|
||||||
$shareenabled = dol_sanitizeFileName(GETPOST('label', 'alpha'));
|
$shareenabled = dol_sanitizeFileName(GETPOST('shareenabled', 'alpha'));
|
||||||
|
|
||||||
//$db->begin();
|
//$db->begin();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user