You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gzopen() does not use the default stream context when opening HTTP URLs #16883
Right, this makes sense to me. It's a behaviour change though so not sure if it can go in stable branches.
Perhaps an optional context argument like fopen has is also a good idea?
Anyway, fixing the report as-is is not hard at all:
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index df3d270217d..d4905b920e5 100644
--- a/ext/zlib/zlib.c+++ b/ext/zlib/zlib.c@@ -28,6 +28,7 @@
#include "ext/standard/info.h"
#include "php_zlib.h"
#include "zlib_arginfo.h"
+#include "ext/standard/file.h"
/*
* zlib include files can define the following preprocessor defines which rename
@@ -659,7 +660,7 @@ PHP_FUNCTION(gzopen)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC);+ stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, php_stream_context_from_zval(NULL, false) STREAMS_CC);
if (!stream) {
RETURN_FALSE;
Activity
ndossche commentedon Nov 21, 2024
Right, this makes sense to me. It's a behaviour change though so not sure if it can go in stable branches.
Perhaps an optional context argument like fopen has is also a good idea?
Anyway, fixing the report as-is is not hard at all:
Fix phpGH-16883: gzopen() does not use the default stream context whe…
Fix phpGH-16883: gzopen() does not use the default stream context whe…