From:             
Operating system: 
PHP version:      5.3.2
Package:          Output Control
Bug Type:         Bug
Bug description:ob_gzhandler doesn't check support for gzip encoding properly

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 bug report at http://bugs.php.net/bug.php?id=51898&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51898&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51898&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51898&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51898&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51898&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51898&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51898&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51898&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51898&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51898&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51898&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51898&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51898&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51898&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51898&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51898&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51898&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51898&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51898&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51898&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51898&r=mysqlcfg

Reply via email to