From 3dcc1c3697133da4ec0070fc0adcea63ee48329d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 22 Sep 2016 10:37:32 -0400 Subject: [PATCH] fix php outputting extra newlines after content --- web/views/image.php | 3 ++- web/views/view_video.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/views/image.php b/web/views/image.php index bce07e765..5278c44a5 100644 --- a/web/views/image.php +++ b/web/views/image.php @@ -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 ) { } } } -?> diff --git a/web/views/view_video.php b/web/views/view_video.php index 4e5e04c0c..d8bf39555 100644 --- a/web/views/view_video.php +++ b/web/views/view_video.php @@ -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); } - -?>