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
 [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: Fri Nov 22 06:01:30 2024 UTC