Leave output buffering alone, since trying to turn it off makes the download fail

The browser was giving "Failed - Network error" and there was nothing in the server log. ob_get_level() was giving 3, but trying to turn it using ob_end_clean() was just... failing.
This commit is contained in:
nathan 2022-04-20 09:45:15 -06:00
parent b32e68c541
commit df489f14df

View File

@ -446,18 +446,14 @@ class importexport_export_ui {
$appname = $_GET['_appname'];
$nicefname = $_GET['filename'] ? $_GET['filename'] : 'egw_export_'.$appname.'-'.date('Y-m-d');
// Turn off all output buffering
while (@ob_end_clean());
$file = fopen($tmpfname,'rb');
// Get charset
$charset = Api\Cache::getSession('importexport', $tmpfname);
Api\Header\Content::type($nicefname.'.'.$_GET['_suffix'],
($_GET['_type'] ? $_GET['_type'] : 'application/text') . ($charset ? '; charset='.$charset : ''),
filesize($tmpfname));
fpassthru($file);
fpassthru($tmpfname);
unlink($tmpfname);