Merge pull request #18256 from kamil-tekiela/ob_gzhandler

Check whether ob_gzhandler is already in use
This commit is contained in:
Maurício Meneghini Fauth 2023-03-14 15:32:26 -03:00 committed by GitHub
commit a3dd6f1e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ use function defined;
use function flush;
use function function_exists;
use function header;
use function in_array;
use function ini_get;
use function ob_end_clean;
use function ob_flush;
@ -15,6 +16,7 @@ use function ob_get_contents;
use function ob_get_length;
use function ob_get_level;
use function ob_get_status;
use function ob_list_handlers;
use function ob_start;
use function sprintf;
@ -78,7 +80,7 @@ class OutputBuffering
return;
}
if ($this->mode && function_exists('ob_gzhandler')) {
if ($this->mode && function_exists('ob_gzhandler') && ! in_array('ob_gzhandler', ob_list_handlers())) {
ob_start('ob_gzhandler');
}