fix: use ob_end_clean() instead of ob_end_flush() in readfileLowMemory() (#37298)

* fix: use ob_end_clean() instead of ob_end_flush() in readfileLowMemory() (fixes #37239)

* fix: use robust ob level cleanup loop per hregis review

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
minimexat 2026-02-23 01:36:32 +01:00 committed by GitHub
parent dad5f55081
commit dd3709be29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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