From: tjerk dot meesters at gmail dot com
Operating system: Linux
PHP version: 5.1.5
PHP Bug Type: Streams related
Bug description: array_filter: support for additional callback arguments
Description:
------------
When file_get_contents() is used in combination with
stream_context_create() not all wrapper options are taken into
consideration.
Tested PHP versions on Linux:
5.1.5 - not working
5.1.1 - working
5.0.4 - working
This bug doesn't seems to appear on Windows platforms:
5.1.5 - working
Reproduce code:
---------------
<?php
// this code will perform a POST request to a URL with this code:
// print_r($_POST)
echo
file_get_contents("http://www.example.com/info.php",null,stream_context_create(array(
'http' => array(
'method' => 'POST',
'content' => 'cmd=_notify-validate',
'header' => 'Content-Type:
application/x-www-form-urlencoded',
)
)));
?>
Expected result:
----------------
Array
(
[cmd] => _notify-validate
)
The meta information:
CONTENT_LENGTH: 20
REQUEST_METHOD: POST
CONTENT_TYPE: application/x-www-form-urlencoded
Actual result:
--------------
Array
(
)
The meta information:
HTTP_USER_AGENT: PHP/5.1.5 <-- this didnt't appear anywhere else
REQUEST_METHOD: GET
CONTENT_TYPE: application/x-www-form-urlencoded
--
Edit bug report at http://bugs.php.net/?id=38654&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38654&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38654&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38654&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38654&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38654&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38654&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38654&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38654&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38654&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38654&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38654&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38654&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38654&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38654&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38654&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38654&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38654&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38654&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38654&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38654&r=mysqlcfg