Ticket #4342 (closed defect: fixed)

Opened 1 year ago

Last modified 5 months ago

gzhandler warning

Reported by: F3rn4nd0 Assigned to: ryan
Priority: normal Milestone: 2.5
Component: Optimization Version: 2.2
Severity: normal Keywords: has-patch commit
Cc:

Description

Sometimes I can see a warning in the upper side like this: Warning: ob_start(): output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter related to file functions.php

I found a patch using:

  if ( extension_loaded('zlib') )
      {
         ob_end_clean();
         ob_start('ob_gzhandler');
      }
   }

instead of

      if ( extension_loaded('zlib') )
      {
         ob_start('ob_gzhandler');
      }
   }

It seems to work

Attachments

4342.r6563.diff (505 bytes) - added by darkdragon on 01/06/08 04:50:05.
Patch based off of r6563

Change History

05/26/07 23:23:57 changed by rob1n

  • milestone changed from 2.4 to 2.2.1.

Makes sense. Possibly another output buffer had started.

06/02/07 03:09:14 changed by rob1n

  • milestone changed from 2.2.1 to 2.2.2.

06/02/07 03:09:24 changed by rob1n

  • milestone changed from 2.2.2 to 2.3.

01/06/08 04:34:22 changed by darkdragon

It is possible to check as to whether another output buffer had started?

Oh, ob_end_clean() probably shouldn't be used if another buffer had started. Unless you wish to discard the contents.

01/06/08 04:50:05 changed by darkdragon

  • attachment 4342.r6563.diff added.

Patch based off of r6563

01/06/08 04:50:55 changed by darkdragon

  • keywords set to has-patch needs-testing.

Needs testing (unit testing) on whether or not an notice is thrown if there is no output buffer active when ob_clean_flush() is called.

01/06/08 04:51:08 changed by darkdragon

E_NOTICE has to be on in order to see if there is a notice.

01/13/08 17:55:59 changed by darkdragon

  • keywords changed from has-patch needs-testing to has-patch commit.

01/27/08 05:55:44 changed by darkdragon

Can this go in?

01/28/08 17:59:50 changed by ryan

Let's just get rid of gzip_compression(). It's caused too many problems for such a small bit of code.

02/07/08 18:08:21 changed by ryan

  • owner changed from anonymous to ryan.

02/07/08 20:36:28 changed by markjaquith

Yeah... plus, this is something that is much better if activated by a server admin at the PHP or HTTP server level. +1 for axing it. One less option!

02/10/08 07:12:34 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6775]) Remove gzip_compression(). Leave it to the server. fixes #4342