]> granicus.if.org Git - php/commitdiff
MFB: add request_order INI variable to control $_REQUEST content
authorStanislav Malyshev <stas@php.net>
Wed, 12 Mar 2008 20:53:04 +0000 (20:53 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 12 Mar 2008 20:53:04 +0000 (20:53 +0000)
# if not set (default), variables_order still is used
# request_order accepts G,P and C

main/main.c
main/php_globals.h
main/php_variables.c
php.ini-dist
php.ini-recommended

index 419d922e5e48b580b3898cd5ffe7a31617137cfd..e1ded5d58ad6d217899aa507d0e352d31f990091 100644 (file)
@@ -529,6 +529,7 @@ PHP_INI_BEGIN()
 
        STD_PHP_INI_ENTRY("user_dir",                           NULL,           PHP_INI_SYSTEM,         OnUpdateString,                 user_dir,                               php_core_globals,       core_globals)
        STD_PHP_INI_ENTRY("variables_order",            "EGPCS",        PHP_INI_SYSTEM|PHP_INI_PERDIR,          OnUpdateStringUnempty,  variables_order,                php_core_globals,       core_globals)
+       STD_PHP_INI_ENTRY("request_order",                      NULL,           PHP_INI_SYSTEM|PHP_INI_PERDIR,          OnUpdateString, request_order,          php_core_globals,       core_globals)
 
        STD_PHP_INI_ENTRY("error_append_string",        NULL,           PHP_INI_ALL,            OnUpdateString,                 error_append_string,    php_core_globals,       core_globals)
        STD_PHP_INI_ENTRY("error_prepend_string",       NULL,           PHP_INI_ALL,            OnUpdateString,                 error_prepend_string,   php_core_globals,       core_globals)
index 0457e7ce0f93512daba44068df00ea4ba9ac42e8..b37ea5f3ab2bb15679ebd5cb04fe1b350a9a2927 100644 (file)
@@ -148,6 +148,8 @@ struct _php_core_globals {
 
        char *user_ini_filename;
        long user_ini_cache_ttl;
+
+       char *request_order;
 };
 
 
index 60eb79806cd1d9eecba4e7b4eaecf86f71a5f5f0..850db25e2cd77639249aa3a4a06509eff9a0666c 100644 (file)
@@ -1010,7 +1010,13 @@ static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRML
        array_init(form_variables);
        INIT_PZVAL(form_variables);
 
-       for (p = PG(variables_order); p && *p; p++) {
+       if(PG(request_order) != NULL) {
+               p = PG(request_order);
+       } else {
+               p = PG(variables_order);
+       }
+
+       for (; p && *p; p++) {
                switch (*p) {
                        case 'g':
                        case 'G':
index 6099a3e00386e4e75208c37eaa3bae02b9e99a5d..a3dee362f7be20080cc745ef3fa3e673e8f20184 100644 (file)
@@ -360,6 +360,12 @@ track_errors = Off
 ; values override older values.
 variables_order = "EGPCS"
 
+; This directive describes the order in which PHP registers GET, POST and Cookie
+; variables into the _REQUEST array. Registration is done from left to right, 
+; newer values override older values.
+; If this directive is not set, variables_order is used for _REQUEST contents.
+; request_order = "GP"
 ; This directive tells PHP whether to declare the argv&argc variables (that
 ; would contain the GET information).  If you don't use these variables, you
 ; should turn it off for increased performance.
index 35584b13e4f7d7674f7ba3ce7624bd6e238536fb..ef5c80ba0eea3b876b413ba76e34ab3799e65175 100644 (file)
@@ -399,6 +399,12 @@ track_errors = Off
 ; values override older values.
 variables_order = "GPCS"
 
+; This directive describes the order in which PHP registers GET, POST and Cookie
+; variables into the _REQUEST array. Registration is done from left to right, 
+; newer values override older values.
+; If this directive is not set, variables_order is used for _REQUEST contents.
+request_order = "GP"
+
 ; This directive tells PHP whether to declare the argv&argc variables (that
 ; would contain the GET information).  If you don't use these variables, you
 ; should turn it off for increased performance.