diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bba94b3f1bb..2dfa39b3165 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -15648,8 +15648,10 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) } // Be sure we don't have output buffering enabled to have readfile working correctly - while (ob_get_level()) { - ob_end_flush(); + $level = ob_get_level(); + ob_start(); + while (ob_get_level() > $level) { + ob_end_clean(); } // Solution 0