WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#4342 closed defect (bug) (fixed)

gzhandler warning

Reported by: F3rn4nd0 Owned by: ryan
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.2
Component: Optimization Keywords: has-patch commit
Focuses: Cc:
PR Number:

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 (1)

4342.r6563.diff (505 bytes) - added by darkdragon 12 years ago.
Patch based off of r6563

Download all attachments as: .zip

Change History (13)

#1 @rob1n
12 years ago

  • Milestone changed from 2.4 to 2.2.1

Makes sense. Possibly another output buffer had started.

#2 @rob1n
12 years ago

  • Milestone changed from 2.2.1 to 2.2.2

#3 @rob1n
12 years ago

  • Milestone changed from 2.2.2 to 2.3

#4 @darkdragon
12 years ago

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.

@darkdragon
12 years ago

Patch based off of r6563

#5 @darkdragon
12 years ago

  • Keywords has-patch needs-testing added

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.

#6 @darkdragon
12 years ago

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

#7 @darkdragon
12 years ago

  • Keywords commit added; needs-testing removed

#8 @darkdragon
12 years ago

Can this go in?

#9 @ryan
12 years ago

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

#10 @ryan
12 years ago

  • Owner changed from anonymous to ryan

#11 @markjaquith
12 years ago

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!

#12 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.