Edit report at https://bugs.php.net/bug.php?id=51898&edit=1
ID: 51898 Updated by: m...@php.net Reported by: dom at w3 dot org Summary: ob_gzhandler doesn't check support for gzip encoding properly -Status: Verified +Status: Wont fix Type: Bug -Package: Output Control +Package: Zlib related PHP Version: 5.3.2 Assigned To: mike Block user comment: N Private report: N New Comment: I'd suggest using pecl/http or mod_deflate for a more sophisticated check. Previous Comments: ------------------------------------------------------------------------ [2010-05-24 14:18:37] dom at w3 dot org Description: ------------ ob_start(ob_gzhandler) can be used to send optionally compressed-output to clients. But the test made to check whether the client supports gzip/deflate encoding only looks at the appearance of the string "gzip" (resp. "deflate") in the Accept-Encoding header, but doesn't actually parse the said header. This means that the following Accept-Encoding headers will trigger generation of gzip-compressed output when they should not: * using a string with gzip in it Accept-Encoding: foogzip25 * using quality parameters as made possible in HTTP Accept-Encoding: gzip;q=0, identity;q=1 Test script: --------------- <?php if (!ob_start("ob_gzhandler")) { ob_start(); echo "Uncompressed"; } else { echo "Compressed"; } ob_end_flush(); ?> Expected result: ---------------- The script below can be used to test with the accept-encoding reported above; the said accept-encoding should report "Uncompressed" but reports "Compressed" (gzipped). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=51898&edit=1