Fix param attachment

This commit is contained in:
Laurent Destailleur 2018-12-17 18:48:41 +01:00
parent ffaff4dc7f
commit 1faaed504a

View File

@ -107,12 +107,6 @@ if (in_array($modulepart, array('facture_paiement','unpaid')))
* View
*/
// Define attachment (attachment=true to force choice popup 'open'/'save as')
$attachment = true;
if (preg_match('/\.(html|htm)$/i',$original_file)) $attachment = false;
if (isset($_GET["attachment"])) $attachment = GETPOST("attachment",'alpha')?true:false;
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
// If we have a hash public (hashp), we guess the original_file.
if (! empty($hashp))
{
@ -155,6 +149,12 @@ if (! empty($hashp))
}
}
// Define attachment (attachment=true to force choice popup 'open'/'save as')
$attachment = true;
if (preg_match('/\.(html|htm)$/i',$original_file)) $attachment = false;
if (isset($_GET["attachment"])) $attachment = GETPOST("attachment",'alpha')?true:false;
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
// Define mime type
$type = 'application/octet-stream';
if (GETPOST('type','alpha')) $type=GETPOST('type','alpha');