php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68778 zlib.output_compression does not parse Accept-Encoding correct
Submitted: 2015-01-09 14:07 UTC Modified: 2020-09-22 14:58 UTC
From: ingo dot flaschberger at openresearch dot com Assigned:
Status: Verified Package: Zlib related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ingo dot flaschberger at openresearch dot com
New email:
PHP Version: OS:

 

 [2015-01-09 14:07 UTC] ingo dot flaschberger at openresearch dot com
Description:
------------
In ext/zlib/zlib.c:static PHP_FUNCTION(ob_gzhandler)
the HTTP_ACCEPT_ENCODING is not parsed.

PHP only checks, if the string "gzip" oder "deflate" is inside the header and enables outputcompression if set.

RFC2616 allows for example that a probability (q) is set, which could be also 0 (disable compression) but PHP will enable it.

For example:
Accept-Encoding: gzip;q=0.0
   actual result: compressed output
   expected result: uncompressed output

Accept-Encoding: thisisnotavalidgzipacceptencoding
   actual result: compressed output
   expected result: uncompressed output

   

Test script:
---------------
<?php

ini_set("zlib.output_compression", "1");
ob_start();
echo "foo";
ob_get_clean();



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-22 14:58 UTC] cmb@php.net
-Status: Open +Status: Verified
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 09:01:33 2024 UTC