Fix phpunit

This commit is contained in:
Laurent Destailleur 2025-01-20 02:31:41 +01:00
parent 08d32dbf25
commit 8d3e7bfc6d

View File

@ -208,45 +208,43 @@ if ($rss) {
}
}
if ($result >= 0) {
$attachment = false;
if (GETPOSTISSET("attachment")) {
$attachment = GETPOST("attachment");
}
//$attachment = false;
$contenttype = 'application/rss+xml';
if (GETPOSTISSET("contenttype")) {
$contenttype = GETPOST("contenttype");
}
//$contenttype='text/plain';
$outputencoding = 'UTF-8';
if ($contenttype) {
header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : ''));
}
if ($attachment) {
header('Content-Disposition: attachment; filename="'.$filename.'"');
}
// Ajout directives pour resoudre bug IE
//header('Cache-Control: Public, must-revalidate');
//header('Pragma: public');
if ($cachedelay) {
header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate');
} else {
header('Cache-Control: private, must-revalidate');
}
// Clean parameters
$outputfile = $dir_temp.'/'.$filename;
$result = readfile($outputfile);
if (!$result) {
print 'File '.$outputfile.' was empty.';
}
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit;
$attachment = false;
if (GETPOSTISSET("attachment")) {
$attachment = GETPOST("attachment");
}
//$attachment = false;
$contenttype = 'application/rss+xml';
if (GETPOSTISSET("contenttype")) {
$contenttype = GETPOST("contenttype");
}
//$contenttype='text/plain';
$outputencoding = 'UTF-8';
if ($contenttype) {
header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : ''));
}
if ($attachment) {
header('Content-Disposition: attachment; filename="'.$filename.'"');
}
// Ajout directives pour resoudre bug IE
//header('Cache-Control: Public, must-revalidate');
//header('Pragma: public');
if ($cachedelay) {
header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate');
} else {
header('Cache-Control: private, must-revalidate');
}
// Clean parameters
$outputfile = $dir_temp.'/'.$filename;
$result = readfile($outputfile);
if (!$result) {
print 'File '.$outputfile.' was empty.';
}
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit;
} elseif ($modulepart == "mycompany" && preg_match('/^\/?logos\//', $original_file)) {
// Get logos
readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file));