diff --git a/htdocs/website/samples/wrapper.html b/htdocs/website/samples/wrapper.html index aafe0cc71e3..7a3932c1608 100644 --- a/htdocs/website/samples/wrapper.html +++ b/htdocs/website/samples/wrapper.html @@ -5,10 +5,10 @@ if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_ include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $encoding = ''; -$hashp=GETPOST('hashp','aZ09'); -$modulepart=GETPOST('modulepart','aZ09'); -$entity=GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity; -$original_file=GETPOST("file","alpha"); +$hashp=GETPOST('hashp', 'aZ09'); +$modulepart=GETPOST('modulepart', 'aZ09'); +$entity=GETPOST('entity', 'int')?GETPOST('entity', 'int'):$conf->entity; +$original_file=GETPOST("file", "alpha"); // If we have a hash public (hashp), we guess the original_file. if (! empty($hashp)) @@ -54,13 +54,13 @@ 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",'none')?true:false; +if (preg_match('/\.(html|htm)$/i', $original_file)) $attachment = false; +if (isset($_GET["attachment"])) $attachment = GETPOST("attachment", 'none')?true:false; if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS_WEBSITE)) $attachment=false; // Define mime type $type = 'application/octet-stream'; -if (GETPOST('type','none')) $type=GETPOST('type','alpha'); +if (GETPOST('type','none')) $type=GETPOST('type', 'alpha'); else $type=dol_mimetype($original_file); // Security: Delete string ../ into $original_file