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: -
From: ingo dot flaschberger at openresearch dot com Assigned:
Status: Open Package: Zlib related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 15:01:48 2019 UTC