php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38654 stream functions seem not affected by stream_context_create()
Submitted: 2006-08-30 10:48 UTC Modified: 2006-09-01 12:58 UTC
From: tjerk dot meesters at gmail dot com Assigned:
Status: Closed Package: Streams related
PHP Version: 5.1.5 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tjerk dot meesters at gmail dot com
New email:
PHP Version: OS:

 

 [2006-08-30 10:48 UTC] tjerk dot meesters at gmail dot com
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-30 11:00 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Can't reproduce with both 5.1.5 and 5.2-CVS.
 [2006-08-30 15:05 UTC] tjerk dot meesters at gmail dot com
updated summary ...
 [2006-08-30 15:17 UTC] tony2001@php.net
Still not reproducible.
 [2006-08-31 11:50 UTC] tjerk dot meesters at gmail dot com
Bug still present in 5.1.6, but it seems to be resolved in 5.2.0RC3-dev
 [2006-09-01 12:58 UTC] tony2001@php.net
5.2.0 is the next release.
Fixed -> closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 11:01:28 2024 UTC