Skip to content

Commit d335bd4

Browse files
committed
Fix bug #47925 again
The naming of the userland functions is terrible and confused me. gzdecode() is actually the function to decompress a gzip stream, and gzuncompress() is the one to decompress a deflate stream... See zlib.c to see the internal function -> type mapping.
1 parent 79862f2 commit d335bd4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ext/soap/php_http.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,12 +1258,12 @@ int make_http_soap_request(zval *this_ptr,
12581258

12591259
if ((strcmp(content_encoding,"gzip") == 0 ||
12601260
strcmp(content_encoding,"x-gzip") == 0) &&
1261-
zend_hash_str_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1)) {
1262-
ZVAL_STRING(&func, "gzuncompress");
1261+
zend_hash_str_exists(EG(function_table), "gzdecode", sizeof("gzdecode")-1)) {
1262+
ZVAL_STRING(&func, "gzdecode");
12631263
ZVAL_STR_COPY(&params[0], http_body);
12641264
} else if (strcmp(content_encoding,"deflate") == 0 &&
1265-
zend_hash_str_exists(EG(function_table), "gzinflate", sizeof("gzinflate")-1)) {
1266-
ZVAL_STRING(&func, "gzinflate");
1265+
zend_hash_str_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1)) {
1266+
ZVAL_STRING(&func, "gzuncompress");
12671267
ZVAL_STR_COPY(&params[0], http_body);
12681268
} else {
12691269
efree(content_encoding);

ext/soap/tests/bugs/bug47925.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function test($compressed_response, $compression_name) {
3232
http_server_kill($pid);
3333
}
3434

35-
test(gzcompress($plain_response), "gzip");
36-
test(gzdeflate($plain_response), "deflate");
35+
test(gzencode($plain_response), "gzip");
36+
test(gzcompress($plain_response), "deflate");
3737
?>
3838
--EXPECT--
3939
int(7)

0 commit comments

Comments
 (0)