diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/eventsource.php | 2 | ||||
-rw-r--r-- | lib/files.php | 2 | ||||
-rw-r--r-- | lib/filesystemview.php | 2 | ||||
-rwxr-xr-x | lib/util.php | 15 |
4 files changed, 15 insertions, 6 deletions
diff --git a/lib/eventsource.php b/lib/eventsource.php index 578441ee707..1b8033943a1 100644 --- a/lib/eventsource.php +++ b/lib/eventsource.php @@ -32,7 +32,7 @@ class OC_EventSource{ private $fallBackId=0; public function __construct() { - @ob_end_clean(); + OC_Util::obEnd(); header('Cache-Control: no-cache'); $this->fallback=isset($_GET['fallback']) and $_GET['fallback']=='true'; if($this->fallback) { diff --git a/lib/files.php b/lib/files.php index 912de5655b0..b4a4145a493 100644 --- a/lib/files.php +++ b/lib/files.php @@ -195,7 +195,7 @@ class OC_Files { $zip=false; $filename=$dir.'/'.$files; } - @ob_end_clean(); + OC_Util::obEnd(); if($zip or OC_Filesystem::is_readable($filename)) { header('Content-Disposition: attachment; filename="'.basename($filename).'"'); header('Content-Transfer-Encoding: binary'); diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 0229213ebcb..1185c25c240 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -195,7 +195,7 @@ class OC_FilesystemView { return $this->basicOperation('filesize', $path); } public function readfile($path) { - @ob_end_clean(); + OC_Util::obEnd(); $handle=$this->fopen($path, 'rb'); if ($handle) { $chunkSize = 8192;// 8 MB chunks diff --git a/lib/util.php b/lib/util.php index adec69248d5..2ee3f0e4efb 100755 --- a/lib/util.php +++ b/lib/util.php @@ -594,22 +594,31 @@ class OC_Util { $connected = @fsockopen("www.owncloud.org", 80); if ($connected) { fclose($connected); - return true; + return true; }else{ // second try in case one server is down $connected = @fsockopen("apps.owncloud.com", 80); if ($connected) { fclose($connected); - return true; + return true; }else{ - return false; + return false; } } } + /** + * clear all levels of output buffering + */ + public static function obEnd(){ + while (ob_get_level()) { + ob_end_clean(); + } + } + /** * @brief Generates a cryptographical secure pseudorandom string |