From: omikorn at yahoo dot com
Operating system: all
PHP version: 4.4.4
PHP Bug Type: HTTP related
Bug description: url wrappers
Description:
------------
Ok there is a problem with URL wrappers when the remote server requires
authentification.
Reproduce code:
---------------
Take file_get_contents for example:
//example code
$user="user";
$pass="somepassword";
$url = "www.whatever.com/members/messages.xml"
$content = file_get_contents("http://$user:[EMAIL PROTECTED]");
$echo "Your new message is\n";
On the packet capture the things show like this:
T 65.111.170.157:33470 -> 196.34.149.111:80 [AP]
GET /members/messages.xml HTTP/1.0\r\n
HTTP/1.0\r\n
##
T 65.111.170.157:33470 -> 196.34.149.111:80 [AP]
Authorization: Basic bWI1MTptYXJpbHluMw==\r\nHost:
www.property24online.co.za\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?
e.g:
GET /members/messages.xml HTTP/1.0\r\n
Authorization: Basic bWI1MTptYXJpbHluMw==\r\nHost:
www.property24online.co.za\r\n
HTTP/1.0\r\n\r\n
--
Edit bug report at http://bugs.php.net/?id=39324&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39324&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39324&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39324&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39324&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39324&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39324&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39324&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39324&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39324&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39324&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39324&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39324&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39324&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39324&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39324&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39324&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39324&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39324&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39324&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39324&r=mysqlcfg