mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 11:19:50 +03:00
42 lines
1.9 KiB
Diff
42 lines
1.9 KiB
Diff
From 792012885d1926ffc96bed3280e7e9560a54a9ad Mon Sep 17 00:00:00 2001
|
|
From: "Christoph M. Becker" <cmbecker69@gmx.de>
|
|
Date: Tue, 12 Apr 2022 17:18:00 +0200
|
|
Subject: [PATCH] Fix GH-8218: ob_end_clean does not reset Content-Encoding
|
|
header
|
|
|
|
Patch-source: https://github.com/php/php-src/pull/8353
|
|
|
|
The fix for GH-7953 introduced a regression by being to deliberate
|
|
adding the respective headers. These must only be added, if the
|
|
handler starts, but is not finalizing.
|
|
---
|
|
ext/iconv/iconv.c | 2 +-
|
|
ext/zlib/zlib.c | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
|
|
index 7a66c965e3cb..f23aa90f52db 100644
|
|
--- a/ext/iconv/iconv.c
|
|
+++ b/ext/iconv/iconv.c
|
|
@@ -311,7 +311,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
|
|
mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE;
|
|
}
|
|
|
|
- if (mimetype != NULL && (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN) || (output_context->op & PHP_OUTPUT_HANDLER_START))) {
|
|
+ if (mimetype != NULL && (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN) || ((output_context->op & PHP_OUTPUT_HANDLER_START) && !(output_context->op & PHP_OUTPUT_HANDLER_FINAL)))) {
|
|
size_t len;
|
|
char *p = strstr(get_output_encoding(), "//");
|
|
|
|
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
|
|
index f7cf0d5dac76..774a31e18cd4 100644
|
|
--- a/ext/zlib/zlib.c
|
|
+++ b/ext/zlib/zlib.c
|
|
@@ -281,7 +281,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
|
|
return FAILURE;
|
|
}
|
|
|
|
- if (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN) || (output_context->op & PHP_OUTPUT_HANDLER_START)) {
|
|
+ if (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN) || ((output_context->op & PHP_OUTPUT_HANDLER_START) && !(output_context->op & PHP_OUTPUT_HANDLER_FINAL))) {
|
|
int flags;
|
|
|
|
if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags)) {
|