ID: 16155
Updated by: rlm@pricegrabber.com
Reported By: rlm@pricegrabber.com
Status: Open
Bug Type: Feature/Change Request
Operating System: RH 7.2
PHP Version: 4.1.2
New Comment:
Oops.
That should be
track_vars On
That's all. What this implies is that if track_vars is on,
variables_order shouldn't prohibit any HTTP_*_VARS variable from being
set (i.e., parsing always occurs). The only utility that
variables_order gives you is the ability to say with some certainty
where a particular global might have originated given overlapping names
in two or more sources. That is, if I have a foo in my cookies, a url
that looks like http://www.blorg.com/blech.php?foo=bar, and a
POST var
called foo on the same page, AND if variables_order is set to "CGP", I
know for sure that the global $foo came from the POST if there was one,
then from the Get (URL), then from the cookies. And that's it!
Previous Comments:
------------------------------------------------------------------------
[2002-07-10 18:57:33] rlm@pricegrabber.com
No, it won't, because that will also add the variables to the global
namespace. This is not a feature request -- it's *making the system
work as advertised*. There already is -- or should be, if the writers
of the documentation were correct -- a way to disable global variable
imports, which ought to be the configuration lines
register_globals = Off
variables_order = ""
That is,
- register_globals should control the registration of globals, and
- variables_order should control the source(s) of and order of
global variable parsing.
Just like it says in the documentation:
"variables_order string
Set the order of the EGPCS (Environment, GET, POST, Cookie, Server)
variable parsing. The default setting of this directive is "EGPCS".
Setting this to "GP", for example, will cause PHP to completely ignore
environment variables, cookies and server variables, and to overwrite
any GET method variables with POST-method variables of the same name."
Notice how the above makes NO mention of whether track_vars is set --
but that doesn't matter, because track_vars IS ALWAYS SET ON! That
implies that variable tracking in HTTP_*_VARS should ALWAYS happen.
ALWAYS.
The tools to do this already exists. This is not a feature but a bug
-- the extant documentation describes a rationally behaving
environment, but PHP no longer conforms to it.
------------------------------------------------------------------------
[2002-07-10 18:21:53] philip@php.net
Just set the PHP predefined variables you want in the variables_order
directive. Like, GPCS or EGPCS. And turn register_globals off. This
will do what you want.
I'm turning this into a feature request and changing the summary. See
Rasmus' post/thread for details on this request.
Whoever decided that variables_order should be 'es' during your install
should be informed on the matter too.
------------------------------------------------------------------------
[2002-07-10 16:37:44] rlm@pricegrabber.com
See my earlier comments but the possibility of the combination of
track_vars=on and register_globals=off is entirely desirable. That is,
we want PHP to pick up variables from the URL, POST, cookies, etc. into
HTTP_GET_VARS etc. WITHOUT importing them into the namespace.
------------------------------------------------------------------------
[2002-07-10 14:09:36] philip@php.net
The various places are the: variables_order, register_globals, and
predefind variables manual entries.
track_vars documentation states it's always on as of 4.0.3, do you feel
this should be reworded? I'll add a reference to variables_order
there.
This bug remains open and I believe remains until a solution is found
that doesn't affect BC. Obviously some concern exists, see that
thread. There was a time when the register_globals directive didn't
even exist.
------------------------------------------------------------------------
[2002-07-10 13:46:01] rlm@pricegrabber.com
In WHICH "various places" is this misbehavior documented? And why is
it NOT documented in the one place it should be mandatory -- the
"track_vars" documentation?
http://www.php.net/manual/en/configuration.php#ini.track-vars
And finally -- since you brought it up -- why isn't track_vars
functional obsolescence documented along with that variable?
I've said it before, and in this same bug -- this behavior amounts to
poor design under the "least surprise" principle.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/16155
--
Edit this bug report at http://bugs.php.net/?id=16155&edit=1