Bug #51210 [NEW]: request_order prevents _COOKIE populating _REQUEST
From:
Operating system: any
PHP version: 5.3.1
Package: *Configuration Issues
Bug Type: Bug
Bug description:request_order prevents _COOKIE populating _REQUEST
Description:
------------
PHP 5.3 introduced a new configuration option named 'request_order'.
# Added "request_order" INI variable to control specifically _REQUEST
behavior. (Stas)"
http://www.php.net/ChangeLog-5.php#5.3.0
It's default value within php.ini (and related comments) are:
--
; This directive determines which super global data (G,P,C,E & S) should
; be registered into the super global array REQUEST. If so, it also
determines
; the order in which that data is registered. The values for this directive
are
; specified in the same manner as the variables_order directive, EXCEPT
one.
; Leaving this value empty will cause PHP to use the value set in the
; variables_order directive. It does not mean it will leave the super
globals
; array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; http://www.php.net/manual/en/ini.core.php#ini.request-order
request_order = "GP"
--
This variable omits 'C' for COOKIES.
Versions prior to PHP 5.3 merged the contents of the _COOKIE array into
_REQUEST.
Due to this default configuration change, _REQUEST can no longer be used to
access cookie values without modifying the request_order php.ini variable.
This changes how _REQUEST is used in PHP 5.3 by default.
This appears to be an oversight/bug, because the PHP documentation still
indicates that _REQUEST can be used to access cookies.
" An associative array that by default contains the contents of _GET, _POST
and _COOKIE. "
http://au2.php.net/manual/en/reserved.variables.request.php
Suggested Fix: Update PHP 5.3's default php.ini configuration file to have
'GPC' instead of 'GP' for 'request_order', to restore prior
functionality.
Test script:
---------------
http://pastebin.com/MmwkU0Z3
Expected result:
----------------
The line '_REQUEST has the cookie, no bug present.' because the default
php.ini config value for request_order should be 'GPC' to include cookies.
Actual result:
--------------
The line '_REQUEST is missing TestCookie, there is a bug.' because the
default php.ini config value for request_order currently omits cookies
('GP').
--
Edit bug report at http://bugs.php.net/bug.php?id=51210&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51210&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51210&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51210&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51210&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51210&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51210&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51210&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51210&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51210&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51210&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51210&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51210&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51210&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51210&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51210&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51210&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51210&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51210&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51210&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51210&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51210&r=mysqlcfg
Thread (1 message)
- phplasma at gmail dot com