[wp-trac] Re: [WordPress Trac] #2831: Gzip support in
class-snoopy.php
WordPress Trac
wp-trac at lists.automattic.com
Mon Jun 26 10:27:59 GMT 2006
#2831: Gzip support in class-snoopy.php
---------------------------------------+------------------------------------
Reporter: Phantagom | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: General | Version: 2.0.4
Severity: normal | Resolution:
Keywords: RSS gzip snoopy has-patch |
---------------------------------------+------------------------------------
Comment (by random):
Ah yes, didn't see that. Sorry.
The built in error handling isn't suited to reporting notices. The whole
point of a notice-level error is that execution can continue despite it,
so a WP-style error object can't be returned. You're totally right about
silently using/not using it.
What about something like this?
{{{
if ( function_exists('gzinflate') ) {
$headers .= "Accept-encoding: gzip\r\n";
$this->gzip_enabled = true;
}
// later ...
if ( $is_gzipped ) {
if ( !$this->gzip_enabled ) {
// Handle the error properly, or just...
return false;
}
// unzip
}
}}}
The latter condition should never be true, but IMO it's important to check
for it, since it actually happened to me a couple of months ago. (A site
was sending everything gzipped even if the accept header wasn't sent.)
--
Ticket URL: <http://trac.wordpress.org/ticket/2831>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list