|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39324 url wrappers
Submitted: 2006-10-31 17:06 UTC Modified: 2006-11-16 01:00 UTC
From: omikorn at yahoo dot com Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 4.4.4 OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: omikorn at yahoo dot com
New email:
PHP Version: OS:


 [2006-10-31 17:06 UTC] omikorn at yahoo dot com
Ok there is a problem with URL wrappers when the remote server requires authentification.

Reproduce code:
Take file_get_contents for example:

//example code
$url = ""
$content = file_get_contents("http://$user:$pass@$url");
$echo "Your new message is\n";

On the packet capture the things show like this:

T -> [AP]
  GET /members/messages.xml HTTP/1.0\r\n
T -> [AP]
  Authorization: Basic bWI1MTptYXJpbHluMw==\r\nHost:\r\n\r\n

Of course this failes. Wouldn't it be correct to pass the auth credentials _before_ the HTTP method is specified and more assign a temporary cookie?

GET /members/messages.xml HTTP/1.0\r\n
Authorization: Basic bWI1MTptYXJpbHluMw==\r\nHost:\r\n


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-31 17:16 UTC] omikorn at yahoo dot com

Please make this private or edit post and obfuscate the encoded credentials in my capture.
 [2006-11-08 14:23 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-11-16 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 06:01:30 2024 UTC