Skip to content

Fix bug #47925 again #14348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ext/soap/php_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,16 @@ int make_http_soap_request(zval *this_ptr,
zval retval;
zval params[1];

/* Warning: the zlib function names are chosen in an unfortunate manner.
* Check zlib.c to see how a function corresponds with a particular format. */
if ((strcmp(content_encoding,"gzip") == 0 ||
strcmp(content_encoding,"x-gzip") == 0) &&
zend_hash_str_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1)) {
ZVAL_STRING(&func, "gzuncompress");
zend_hash_str_exists(EG(function_table), "gzdecode", sizeof("gzdecode")-1)) {
ZVAL_STRING(&func, "gzdecode");
ZVAL_STR_COPY(&params[0], http_body);
} else if (strcmp(content_encoding,"deflate") == 0 &&
zend_hash_str_exists(EG(function_table), "gzinflate", sizeof("gzinflate")-1)) {
ZVAL_STRING(&func, "gzinflate");
zend_hash_str_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1)) {
ZVAL_STRING(&func, "gzuncompress");
ZVAL_STR_COPY(&params[0], http_body);
} else {
efree(content_encoding);
Expand Down
4 changes: 2 additions & 2 deletions ext/soap/tests/bugs/bug47925.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function test($compressed_response, $compression_name) {
http_server_kill($pid);
}

test(gzcompress($plain_response), "gzip");
test(gzdeflate($plain_response), "deflate");
test(gzencode($plain_response), "gzip");
test(gzcompress($plain_response), "deflate");
?>
--EXPECT--
int(7)
Expand Down
Loading