[Phpmyadmin-devel] Re: Removing of grab_globals

Michal Čihař michal at cihar.com
Wed Dec 7 07:41:01 CET 2005


Hi

On Wed, 07 Dec 2005 10:06:41 -0500
Marc Delisle <Marc.Delisle at cegepsherbrooke.qc.ca> wrote:

> Sebastian Mendel a écrit :
> > Michal Čihař schrieb:
> >> I suggested to create some function like:
> >>
> >> PMA_grabParameter($name, $request, $sanitizing = 'none', $required =
> >> TRUE)
> >>
> >> The request parameter might not be needed, but it's up to discussion.
> >>
> >> While Marc came with way how Moodle does it:
> >>
> 
> Michal, I showed this Moodle example because you wanted to know what other 
> products are doing. I am not advocating for their mechanism.
> 
> About PMA_grabParameter(), is the second parameter used for the origin of the 
> variable, like GET, POST, COOKIE, SESSION?

It was original purpose.

> >> Comments?
> > 
> > 
> > // ifsetor() ;-)
> > function checkRequest($name, $default = null)
> > {
> >     if ( isset( $_REQUEST[$name] ) ) {
> >         return $_REQUEST[$name];
> >     }
> > 
> >     return $default;
> > }
> > 
> > i think in most cases PMA should use $_REQUEST directly and use one of 
> > the above function only to set default values
> > 
> > using of $_REQUEST makes it more clear where this variable came from, 
> > reminding the developer always to take care with this variables!
> 
> I don't understand why using $_REQUEST makes more clear where this variable came 
> from. In $_REQUEST, variables can come from EGPCS, as defined by the 
> variables_order directive. I think that it's better to say explicitly where we 
> expect each variable to come from.

Many variables can come at least either from POST or GET (see
PMA_linkOrButton [or what's it's name]).

-- 
	Michal Čihař | http://cihar.com




More information about the Developers mailing list