Bug #72686 [Csd]: zlib: url support is broken, that may be a good thing
| From: | pierrick@php.net | Date: | Wed, 27 Jul 2016 04:45:47 +0000 |
| Subject: | Bug #72686 [Csd]: zlib: url support is broken, that may be a good thing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202629@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72686&edit=1
ID: 72686
Updated by: pierrick@php.net
Reported by: ekobrin at akamai dot com
Summary: zlib: url support is broken, that may be a good
thing
Status: Closed
Type: Bug
Package: Streams related
PHP Version: master-Git-2016-07-27 (Git)
-Assigned To:
+Assigned To: pierrick
Block user comment: N
Private report: N
New Comment:
Thanks for the bug and the patch. Bug was introduced before 5.2.0 so I just removed the dead code as
you suggested.
Previous Comments:
------------------------------------------------------------------------
[2016-07-27 04:41:15] pierrick@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=php-src.git;a=commit;h=074b86d8451365c81d3ae76616fb4df1757ddc1f
Log: Fixed bug #72686 (zlib: url support is broken).
------------------------------------------------------------------------
[2016-07-27 02:45:13] ekobrin at akamai dot com
Description:
------------
Line 1772 of streams.c is: '} else if (n == 5 && strncasecmp(path, "zlib:",
5) == 0) '
This is a bug.
If path starts with "zlib:" then n will be 4, not 5.
Since this branch can never be entered, and it only exists to support a deprecated stream type, I
suggest simple deleting the entire "else" clause.
Test script:
---------------
readfile("zlib:file.gz");
Expected result:
----------------
gzip content is extracted, warning (Use of "zlib:" wrapper is deprecated; please use
"compress.zlib://" instead) is printed
Actual result:
--------------
Warning (failed to open stream: No such file or directory) is printed
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72686&edit=1