Browse Source

Fix param attachment

Laurent Destailleur 6 years ago
parent
commit
1faaed504a
1 changed files with 6 additions and 6 deletions
  1. 6 6
      htdocs/document.php

+ 6 - 6
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');