|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25218 PHP sends back invalid deflate data
Submitted: 2003-08-23 06:09 UTC Modified: 2003-08-28 11:22 UTC
From: amb at gedanken dot demon dot co dot uk Assigned:
Status: Closed Package: Zlib related
PHP Version: 4CVS-2003-08-23 (stable) OS:
Private report: No CVE-ID: None
 [2003-08-23 06:09 UTC] amb at gedanken dot demon dot co dot uk
When PHP sends back data using the deflate method it incorrectly puts a gzip style header before it.

I sent this request

GET / HTTP/1.0
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020623 Debian/1.2.5-0.woody.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Keep-Alive: 300
Connection: close
Accept-Encoding: x-deflate; q=0.9, deflate; q=0.9, identity; q=0.1

to and got this reply header

HTTP/1.1 200 OK

Date: Sat, 23 Aug 2003 11:00:34 GMT

Server: Apache/1.3.27 (Unix) PHP/4.3.0

X-Powered-By: PHP/4.3.0

Content-Encoding: deflate

Vary: Accept-Encoding

Connection: close

Content-Type: text/html

with this data (converted to hex format by 'od -x')

0000000 8b1f 0008 0000 0000 0300 9c78 58cc 6fdd
0000020 36db 7f10 feae 038a b587 892f 2765 b643

The first 10 bytes are a valid gzip header (RFC1952), the following 2 bytes are a valid zlib header (RFC1950), the following bytes are valid deflate data (RFC1951).  The first 10 bytes should not be sent.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-24 09:10 UTC]
Thank you for the report, I fixed it in PHP5 CVS, can you try if this works for you?

Because there can be some browser issues, I think it should be tested with PHP5 before the patch goes into the PHP4 branch.
 [2003-08-28 00:16 UTC] amb at gedanken dot demon dot co dot uk
I don't use PHP myself, so I can't test the new version unless there is a web site that is using it somewhere that I can test my client with.
 [2003-08-28 11:22 UTC]
It's now fixed in the PHP_4_3 cvs branch, too, so with a new snapshot it should work.

Sorry, I don't know any site to test for you (yet ...).
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 04:01:29 2024 UTC