Bug #51898 [Opn->Ver]: ob_gzhandler doesn't check support for gzip encoding properly

From: Date: Mon, 19 Sep 2011 14:44:03 +0000
Subject: Bug #51898 [Opn->Ver]: ob_gzhandler doesn't check support for gzip encoding properly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163686@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51898&edit=1 ID: 51898 Updated by: mike@php.net Reported by: dom at w3 dot org Summary: ob_gzhandler doesn't check support for gzip encoding properly -Status: Open +Status: Verified Type: Bug Package: Output Control PHP Version: 5.3.2 -Assigned To: +Assigned To: mike Block user comment: N Private report: N 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

« previous php.bugs (#163686) next »