fix php outputting extra newlines after content

This commit is contained in:
Isaac Connor
2016-09-22 10:37:32 -04:00
parent 95bbaf42b6
commit 3dcc1c3697
2 changed files with 6 additions and 3 deletions

View File

@@ -141,6 +141,8 @@ if( !empty($_REQUEST['height']) ) {
header( 'Content-type: image/jpeg' );
ob_clean();
flush();
if ( $errorText ) {
Error( $errorText );
@@ -187,4 +189,3 @@ if ( $errorText ) {
}
}
}
?>

View File

@@ -85,6 +85,10 @@ header("Content-Range: bytes $begin-$end/$size");
header("Content-Transfer-Encoding: binary\n");
header('Connection: close');
// Apparently without these we get a few extra bytes of output at the end...
ob_clean();
flush();
$cur = $begin;
fseek( $fh, $begin, 0 );
@@ -94,5 +98,3 @@ while( ! feof( $fh ) && $cur < $end && ( connection_status() == 0 ) ) {
$cur += 1024*16;
usleep(100);
}
?>