remove ob_clean stuff which logs errors when output buffering is turned off (#2395)
* remove ob_clean stuff which logs errors when output buffering is turned off. * Don't ob_clean because if buffering is off php will output an error
This commit is contained in:
parent
443fd35d99
commit
5098329d94
|
@ -45,7 +45,6 @@ if ( $archivetype ) {
|
||||||
$filename_path = ZM_DIR_EXPORTS.'/'.$filename;
|
$filename_path = ZM_DIR_EXPORTS.'/'.$filename;
|
||||||
ZM\Logger::Debug("downloading archive from $filename_path");
|
ZM\Logger::Debug("downloading archive from $filename_path");
|
||||||
if ( is_readable($filename_path) ) {
|
if ( is_readable($filename_path) ) {
|
||||||
ob_clean();
|
|
||||||
header("Content-type: application/$mimetype" );
|
header("Content-type: application/$mimetype" );
|
||||||
header("Content-Disposition: inline; filename=$filename");
|
header("Content-Disposition: inline; filename=$filename");
|
||||||
header('Content-Length: ' . filesize($filename_path) );
|
header('Content-Length: ' . filesize($filename_path) );
|
||||||
|
|
|
@ -259,8 +259,6 @@ if ( !empty($_REQUEST['height']) ) {
|
||||||
if ( $errorText ) {
|
if ( $errorText ) {
|
||||||
ZM\Error($errorText);
|
ZM\Error($errorText);
|
||||||
} else {
|
} else {
|
||||||
# Clears the output buffer. Not sure what is there, but have had troubles.
|
|
||||||
ob_end_clean();
|
|
||||||
header('Content-type: image/jpeg');
|
header('Content-type: image/jpeg');
|
||||||
if ( ( $scale==0 || $scale==100 ) && ($width==0) && ($height==0) ) {
|
if ( ( $scale==0 || $scale==100 ) && ($width==0) && ($height==0) ) {
|
||||||
# This is so that Save Image As give a useful filename
|
# This is so that Save Image As give a useful filename
|
||||||
|
@ -309,7 +307,6 @@ ZM\Logger::Debug("Figuring out height using width: $height = ($width * $oldHeigh
|
||||||
imagedestroy($iScale);
|
imagedestroy($iScale);
|
||||||
$scaled_jpeg_data = ob_get_contents();
|
$scaled_jpeg_data = ob_get_contents();
|
||||||
file_put_contents($scaled_path, $scaled_jpeg_data);
|
file_put_contents($scaled_path, $scaled_jpeg_data);
|
||||||
ob_end_clean();
|
|
||||||
echo $scaled_jpeg_data;
|
echo $scaled_jpeg_data;
|
||||||
} else {
|
} else {
|
||||||
ZM\Logger::Debug("Sending $scaled_path");
|
ZM\Logger::Debug("Sending $scaled_path");
|
||||||
|
|
|
@ -98,7 +98,6 @@ if ( $begin > 0 || $end < $size-1 ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apparently without these we get a few extra bytes of output at the end...
|
// Apparently without these we get a few extra bytes of output at the end...
|
||||||
ob_clean();
|
|
||||||
flush();
|
flush();
|
||||||
|
|
||||||
$cur = $begin;
|
$cur = $begin;
|
||||||
|
|
Loading…
Reference in New Issue