[wp-hackers] edit comment form

Will Norris will at willnorris.com
Fri Apr 27 22:15:44 GMT 2007


On Apr 27, 2007, at 12:38 PM, Dougal Campbell wrote:

> Will Norris wrote:
>> I maintain a port of Alan Castonguay's openid plugin at
>> <http://wordpress.org/extend/plugins/openid/> and was recently made
>> aware of a problem when using the plugin with PHP 5.2.  Part of what
>> the plugin does is to modify the comment form to include an  
>> additional
>> input field for a user's OpenID.  To do this, it uses output  
>> buffering
>> to capture the form, then some regex magic to make the necessary
>> changes.  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>.  So I'm now looking for
>> suggestions for how one might modify the comment form.
>
> Have you tried using the superglobal, $GLOBALS['myvar']?
>
> http://us.php.net/manual/en/reserved.variables.php
> http://us.php.net/manual/en/ 
> language.references.spot.php#references.global

yep, everything seems to be completely wiped.  That URL for the bug  
contains some pretty simple code that demonstrates the problem, even  
with $GLOBALS.  I discovered that I could pass data into the callback  
function using $_SESSION, but was trying that only out of  
curiousity... I wouldn't even entertain the thought of using that as  
a "solution".


More information about the wp-hackers mailing list