diff options
author | Wez Furlong <wez@php.net> | 2002-03-16 18:42:42 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-03-16 18:42:42 +0000 |
commit | 5d0c53eecf5e720dd73d14c602a3df9c752e3a67 (patch) | |
tree | 2fc775e01a59df0517b6f4ae884ea238053d4338 /ext/zlib/zlib.c | |
parent | a18000f163f7a5ec618ed1093d5b34b8e8feb631 (diff) | |
download | php-git-5d0c53eecf5e720dd73d14c602a3df9c752e3a67.tar.gz |
Fix some issues with gzFile and fsockopen.
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r-- | ext/zlib/zlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index a0c54fbd81..44edcbdcd3 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -257,7 +257,7 @@ static gzFile php_gzopen_wrapper(char *path, char *mode, int options TSRMLS_DC) stream = php_stream_open_wrapper(path, mode, options | REPORT_ERRORS, NULL TSRMLS_CC); if (stream) { - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_TRY_HARD, (void**)&fd, 1)) + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD|PHP_STREAM_CAST_TRY_HARD, (void**)&fd, 1)) { gzFile ret = gzdopen(fd, mode); if (ret) { @@ -302,8 +302,8 @@ PHP_FUNCTION(gzfile) convert_to_string_ex(filename); /* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */ - stream = php_stream_gzopen(Z_STRVAL_PP(filename), "r", use_include_path|ENFORCE_SAFE_MODE, NULL TSRMLS_CC); - if (!stream) { + stream = php_stream_gzopen(Z_STRVAL_PP(filename), "rb", use_include_path|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL TSRMLS_CC); + if (stream == NULL) { php_error(E_WARNING,"gzFile(\"%s\") - %s",Z_STRVAL_PP(filename),strerror(errno)); RETURN_FALSE; } |