Bug #73841 [NEW]: ob_gzhandler() doesn't fully implement HTTP spec

From: Date: Thu, 29 Dec 2016 23:58:17 +0000
Subject: Bug #73841 [NEW]: ob_gzhandler() doesn't fully implement HTTP spec
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206235@lists.php.net to get a copy of this message
From: giovanni at giacobbi dot net Operating system: Any PHP version: Irrelevant Package: *Compression related Bug Type: Bug Bug description:ob_gzhandler() doesn't fully implement HTTP spec Description: ------------ HTTP spec describes Accept-Encoding as a list with "quality values", i.e. it can be something like: Accept-Encoding: gzip;q=1.0, deflate;q=0.7 There is a special case when q equals zero which means the client does NOT accept that particular value Because the ob_gzhandler() is implemented with a strstr(Z_STRVAL_P(enc), "gzip"), the check fails to exclude "gzip;q=0" Test script: --------------- <?php ob_start("ob_gzhandler"); echo "Hello"; -- Edit bug report at https://bugs.php.net/bug.php?id=73841&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73841&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73841&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73841&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73841&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73841&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73841&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73841&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73841&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73841&r=support Expected behavior: https://bugs.php.net/fix.php?id=73841&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73841&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73841&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73841&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73841&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73841&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73841&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73841&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73841&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73841&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73841&r=mysqlcfg

« previous php.bugs (#206235) next »