stas Wed Mar 12 20:53:04 2008 UTC
Modified files:
/php-src php.ini-dist php.ini-recommended
/php-src/main main.c php_globals.h php_variables.c
Log:
MFB: add request_order INI variable to control $_REQUEST content
# if not set (default), variables_order still is used
# request_order accepts G,P and C
http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?r1=1.272&r2=1.273&diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.272 php-src/php.ini-dist:1.273
--- php-src/php.ini-dist:1.272 Thu Feb 21 13:36:24 2008
+++ php-src/php.ini-dist Wed Mar 12 20:53:04 2008
@@ -360,6 +360,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"
+
; 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.
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.222&r2=1.223&diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.222 php-src/php.ini-recommended:1.223
--- php-src/php.ini-recommended:1.222 Thu Feb 21 13:36:25 2008
+++ php-src/php.ini-recommended Wed Mar 12 20:53:04 2008
@@ -399,6 +399,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"
+
; 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.
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.763&r2=1.764&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.763 php-src/main/main.c:1.764
--- php-src/main/main.c:1.763 Sat Mar 8 22:17:32 2008
+++ php-src/main/main.c Wed Mar 12 20:53:04 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.763 2008/03/08 22:17:32 colder Exp $ */
+/* $Id: main.c,v 1.764 2008/03/12 20:53:04 stas Exp $ */
/* {{{ includes
*/
@@ -529,6 +529,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)
http://cvs.php.net/viewvc.cgi/php-src/main/php_globals.h?r1=1.116&r2=1.117&diff_format=u
Index: php-src/main/php_globals.h
diff -u php-src/main/php_globals.h:1.116 php-src/main/php_globals.h:1.117
--- php-src/main/php_globals.h:1.116 Sat Mar 8 22:17:32 2008
+++ php-src/main/php_globals.h Wed Mar 12 20:53:04 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_globals.h,v 1.116 2008/03/08 22:17:32 colder Exp $ */
+/* $Id: php_globals.h,v 1.117 2008/03/12 20:53:04 stas Exp $ */
#ifndef PHP_GLOBALS_H
#define PHP_GLOBALS_H
@@ -148,6 +148,8 @@
char *user_ini_filename;
long user_ini_cache_ttl;
+
+ char *request_order;
};
http://cvs.php.net/viewvc.cgi/php-src/main/php_variables.c?r1=1.145&r2=1.146&diff_format=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.145 php-src/main/php_variables.c:1.146
--- php-src/main/php_variables.c:1.145 Mon Dec 31 07:12:18 2007
+++ php-src/main/php_variables.c Wed Mar 12 20:53:04 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.145 2007/12/31 07:12:18 sebastian Exp $ */
+/* $Id: php_variables.c,v 1.146 2008/03/12 20:53:04 stas Exp $ */
#include <stdio.h>
#include "php.h"
@@ -1010,7 +1010,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 CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php