Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35456 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23566 invoked by uid 1010); 13 Feb 2008 21:02:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23535 invoked from network); 13 Feb 2008 21:02:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2008 21:02:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:55267] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/EE-24174-3DA53B74 for ; Wed, 13 Feb 2008 16:02:12 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 13 Feb 2008 23:02:13 +0200 Received: from [192.168.16.90] ([192.168.16.90]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 13 Feb 2008 13:02:10 -0800 Message-ID: <47B35ACD.4090900@zend.com> Date: Wed, 13 Feb 2008 13:02:05 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: 'PHP Internals' References: <47AA5354.7020806@zend.com> In-Reply-To: <47AA5354.7020806@zend.com> Content-Type: multipart/mixed; boundary="------------060706010500090804040108" X-OriginalArrivalTime: 13 Feb 2008 21:02:10.0680 (UTC) FILETIME=[B33AB780:01C86E83] Subject: Re: [PHP-DEV] _REQUEST and variable_order From: stas@zend.com (Stanislav Malyshev) --------------060706010500090804040108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > 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 stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com --------------060706010500090804040108 Content-Type: text/plain; name="request.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="request.diff" 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': --------------060706010500090804040108--