matching GET/POST. I think this should be cleaned up so that _REQUEST behavior would conform its use case.

Attached is the patch that implements request_order .ini value. Comments?

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]
Index: php.ini-dist
===================================================================
RCS file: /repository/php-src/php.ini-dist,v
retrieving revision 1.231.2.10.2.22.2.2
diff -u -r1.231.2.10.2.22.2.2 php.ini-dist
--- php.ini-dist        11 Feb 2008 00:01:11 -0000      1.231.2.10.2.22.2.2
+++ php.ini-dist        13 Feb 2008 20:57:20 -0000
@@ -413,6 +413,12 @@
 ; 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"
+
 ; Whether or not to register the EGPCS variables as global variables.  You may
 ; want to turn this off if you don't want to clutter your scripts' global scope
 ; with user data.  This makes most sense when coupled with track_vars - in 
which
Index: php.ini-recommended
===================================================================
RCS file: /repository/php-src/php.ini-recommended,v
retrieving revision 1.179.2.11.2.23.2.2
diff -u -r1.179.2.11.2.23.2.2 php.ini-recommended
--- php.ini-recommended 11 Feb 2008 00:01:11 -0000      1.179.2.11.2.23.2.2
+++ php.ini-recommended 13 Feb 2008 20:57:20 -0000
@@ -464,6 +464,12 @@
 ; 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"
+
 ; Whether or not to register the EGPCS variables as global variables.  You may
 ; want to turn this off if you don't want to clutter your scripts' global scope
 ; with user data.  This makes most sense when coupled with track_vars - in 
which
Index: main/main.c
===================================================================
RCS file: /repository/php-src/main/main.c,v
retrieving revision 1.640.2.23.2.57.2.8
diff -u -r1.640.2.23.2.57.2.8 main.c
--- main/main.c 4 Feb 2008 20:39:21 -0000       1.640.2.23.2.57.2.8
+++ main/main.c 13 Feb 2008 20:57:20 -0000
@@ -436,6 +436,7 @@
 
        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: main/php_globals.h
===================================================================
RCS file: /repository/php-src/main/php_globals.h,v
retrieving revision 1.98.2.1.2.7.2.2
diff -u -r1.98.2.1.2.7.2.2 php_globals.h
--- main/php_globals.h  31 Dec 2007 07:17:17 -0000      1.98.2.1.2.7.2.2
+++ main/php_globals.h  13 Feb 2008 20:57:20 -0000
@@ -164,6 +164,8 @@
 
        char *user_ini_filename;
        long user_ini_cache_ttl;
+
+       char *request_order;
 };
 
 
Index: main/php_variables.c
===================================================================
RCS file: /repository/php-src/main/php_variables.c,v
retrieving revision 1.104.2.10.2.11.2.3
diff -u -r1.104.2.10.2.11.2.3 php_variables.c
--- main/php_variables.c        31 Dec 2007 07:17:17 -0000      
1.104.2.10.2.11.2.3
+++ main/php_variables.c        13 Feb 2008 20:57:20 -0000
@@ -835,7 +835,13 @@
        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':

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to