[wp-hackers] edit comment form
Austin Matzko
if.website at gmail.com
Sat Apr 28 04:38:56 GMT 2007
On 4/27/07, Will Norris <will at willnorris.com> wrote:
> The problem is that it appears the callback
> method specified in ob_start() no longer has access to global
> variables in recent versions of PHP; this is not considered a bug
> <http://bugs.php.net/bug.php?id=40104>.
This seems to work for me: pass the callback function to ob_start as a
method of the global object. Here's how I modified the bug code at
http://bugs.php.net/bug.php?id=40104 to avoid the fatal error:
class foo
{
function bar()
{
}
function foo_bar($buffer)
{
$this->bar();
return $buffer;
}
}
$GLOBALS['fb'] =& new foo; // this will throw a non-fatal error
"Assigning the return value of new by reference is deprecated", but so
does a bunch of stuff in wp-settings.php
ob_start(array(&$fb,'foo_bar'));
More information about the wp-hackers
mailing list