[Project_owners] Mozdev.org PHP 5 upgrade; update code for register_globals = off

Mycroft Project mycroft.mozdev.org at googlemail.com
Mon Jan 14 08:21:06 PST 2008

Thanks - that makes me feel a bit better.
ouple of clarifications...

On 14/01/2008, Douglas E. Warner <silfreed at silfreed.net> wrote:
> On Saturday 12 January 2008, Mycroft Project wrote:
> > I hope I've got something wrong...
> >
> > I tried the php snippet above in a testing directory which seems to be
> > entirely destructive. Adding:
> > echo $$__v, " | ", $__v, " | ", $__sg, "\n";
> > before the unset() line seems to suggest that a lot of the Mozdev
> internals
> > like $page are also scrubbed - I didn't get any output at all from the
> page
> > I was trying to load.
> The snippet I provided probably is too destructive due to mozdev using
> global
> variables a little too liberally.  I'll include an updated version below.
> It would probably be better to use Mozdev's defines for accessing the
> current
> page, which would be PAGE (without a dollar sign) (yes, I know this is
> probably undocumented).

I was about to write that I wasn't using $page anywhere then did a search...
I thought it was Mozdev's use that was stopping the page from loading at all
but no longer entirely sure.

> More generally, if I read
> > http://uk.php.net/manual/en/language.variables.predefined.php correctly
> > then $_GET['foo'] is okay (this wasn't what I understood from the
> original
> > message) but $REMOTE_ADDR has to be replaced by $_SERVER['REMOTE_ADDR']
> It
> > also seems to suggest $HTTP_*_VARS is acceptable (though discouraged)
> given
> > the default value of register_long_arrays.
> $HTTP_*_VARS is also deprecated and should be avoided; it has been removed
> in
> PHP 6.  In general, only the $_* variables should be used for getting
> pre-set
> data from PHP.

Sure, can you confirm how register_long_arrays will be set initially.
Just a matter of prioritising really.



Charles Caygill
Mycroft Project Owner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mozdev.org/pipermail/project_owners/attachments/20080114/ff2c0940/attachment.html 

More information about the Project_owners mailing list