diff --git a/htdocs/document.php b/htdocs/document.php index dd7ca2cb79c..ff6c6f6e635 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -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');