Merge branch 'hotfix' into 3.6

This commit is contained in:
Romain Neutron
2012-01-06 13:35:52 +01:00

View File

@@ -1035,35 +1035,15 @@ class set_export extends set_abstract
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: public");
header("Pragma: no-cache");
header("Content-Type: " . $mime);
header("Content-Length: " . strlen($data));
header("Cache-Control: max-age=3600, must-revalidate ");
header("Content-Disposition: " . $disposition . "; filename=" . $exportname . ";");
echo $data;
exit();
$response = new \Symfony\Component\HttpFoundation\Response();
$response->headers->set('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
$response->setLastModified(new DateTime());
$response->headers->set('Pragma', 'public', true);
$response->headers->set('Content-Type', $mime);
$response->headers->set('Content-Length', strlen($data));
$response->headers->set('Content-Disposition', $disposition. "; filename=" . $exportname . ";");
// header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
//
// header("Pragma: public");
//
// header("Content-Type: " . $mime);
// header("Content-Length: " . strlen($data));
// header("Cache-Control: max-age=3600, must-revalidate ");
// header("Content-Disposition: " . $disposition
// . "; filename=" . $exportname . ";");
//
// echo $data;
$response->send();
exit();
header("Content-Disposition: " . $disposition
. "; filename=" . $exportname . ";");
echo $data;
return true;
}