From 3e2cd54be7002066c961a04d816be06de9063d4b Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Wed, 1 Apr 2015 17:29:21 -0400 Subject: [PATCH] Fixed double sending of headers problem with S3 cache --- airtime_mvc/application/common/FileIO.php | 3 --- airtime_mvc/application/services/MediaService.php | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/airtime_mvc/application/common/FileIO.php b/airtime_mvc/application/common/FileIO.php index 170a5d8b9..e921ca3c1 100644 --- a/airtime_mvc/application/common/FileIO.php +++ b/airtime_mvc/application/common/FileIO.php @@ -63,9 +63,6 @@ class Application_Common_FileIO } } - //Squashes headers() warning on PHP 5.3/ubuntu 12.04: - flush(); - //We can have multiple levels of output buffering. Need to //keep looping until all have been disabled!!! //http://www.php.net/manual/en/function.ob-end-flush.php diff --git a/airtime_mvc/application/services/MediaService.php b/airtime_mvc/application/services/MediaService.php index 7202fd120..55eaeff37 100644 --- a/airtime_mvc/application/services/MediaService.php +++ b/airtime_mvc/application/services/MediaService.php @@ -93,6 +93,7 @@ class Application_Service_MediaService $size= $media->getFileSize(); $mimeType = $media->getPropelOrm()->getDbMime(); Application_Common_FileIO::smartReadFile($filePath, $size, $mimeType); + break; //Break out of the loop if we successfully read the file! } catch (FileNotFoundException $e) { //If we have no alternate filepaths left, then let the exception bubble up. if (sizeof($filePaths) == 0) {