[wp-trac] Re: [WordPress Trac] #9761: Use gzdeflate instead of gzdecode in wp-includes/http.php

WordPress Trac wp-trac at lists.automattic.com
Sat May 9 00:50:59 GMT 2009


#9761: Use gzdeflate instead of gzdecode in wp-includes/http.php
--------------------------+-------------------------------------------------
 Reporter:  josephscott   |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  2.8        
Component:  HTTP          |     Version:  2.8        
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------
Changes (by DD32):

  * keywords:  has-patch => needs-patch


Comment:

 Need some input from Jacob here i suspect.

 However, My understanding is that DEFLATE != COMPRESS != GS ENCODED

 gzcompress() / gzuncompress() - COMPRESS uses ZLIB compression

 gzinflate() / gzdeflate() - DEFLATE data compression - Not compatible with
 mod_deflate, Need to strip the leading 11chars off the string in order to
 deflate it correctly (And it needs to be checked that its actually
 mod_deflate that compressed it)

 gzencode() / gzdecode() - GZIP Compression. encode variety is PHP 4.0.4+,
 decode appears to be PHP6 only as you suggest. This function is compatible
 with mod_deflate as well as gzip'd output.


 Now, As for the patch.
  * gzdeflate() is the method to compress the string, not inflate
 it(uncompress)
  * gzinflate() is tried first, followed by gzuncompress(), and finally
 gzdecode() if all else fails.

 My suggestion would to just wrap the gzdecode() in a function_exists()
 check, PHP6 will eventually be the PHP5 of today..

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9761#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list