From: Edward Chernenko Date: Sun, 1 Apr 2018 21:39:59 +0000 (+0300) Subject: Fix warning "ob_end_flush(): failed to delete and flush buffer" during uploads X-Git-Tag: 1.34.0-rc.0~5595^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=30d72ec3d0914bb905d4114dee9256f02cbdcc7f;hp=7f11daf961e97a78c7893fcf91c614bb777e3559 Fix warning "ob_end_flush(): failed to delete and flush buffer" during uploads Bug: T186565 Change-Id: Ia4b29611ccee4acac11717f5220ff9e0fdbd55a9 --- diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index e430bc8f43..0c37d78b26 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1634,7 +1634,11 @@ class FileRepo { $status = $this->newGood(); $status->merge( $this->backend->streamFile( $params ) ); - ob_end_flush(); + // T186565: Close the buffer, unless it has already been closed + // in HTTPFileStreamer::resetOutputBuffers(). + if ( ob_get_status() ) { + ob_end_flush(); + } return $status; }