php 5.2 compatible scripts and WP plugins

Highlight — Once again, the php devs have done a great job at destroying their language…

Shortly after php 5.1 broke a throng of object oriented php scripts around the world, php 5.2 is about to bring carnage to scripts that rely on output buffers.

The symptom is simple and obvious to anyone who takes a few minutes to look into it: A blatant workflow error destroys variables before the output buffer is flushed. Adding to the insult, the php bug gardeners report that this is not a bug, but a feature.

Anyway, if you’ve the same problem I had, the fix involves moving the output buffer flush to the shutdown hook where it belongs:

# Fix php 5.2 output buffer problems
# Public domain, use and redistribute at will

if ( !function_exists('ob_end_flush_all') ) :
function ob_end_flush_all()
{
  while ( @ob_end_flush() );
}

register_shutdown_function('ob_end_flush_all');
endif;

’nuff grunting. The following WordPress plugins got an update as a result:

  • Admin Menu
  • Ad Spaces (obsolete)
  • External Links
  • Google Analytics

The following plugins were also updated recently:

  • Bookmark Me
  • Frame Buster
  • Newsletter Manager
  • Wysiwyg Editor (obsolete)