php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45701 curl_setopt and CURLOPT_URL detecting wrong username, password, and host..
Submitted: 2008-08-03 14:30 UTC Modified: 2008-08-03 16:20 UTC
From: sergiocrz at hotmail dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.2.6 OS: XP
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: sergiocrz at hotmail dot com
New email:
PHP Version: OS:

 

 [2008-08-03 14:30 UTC] sergiocrz at hotmail dot com
Description:
------------
Using 
curl_setopt($ch, CURLOPT_URL, "ftp://$ftp_user_name:$ftp_pass@$ftp_ip:$ftp_port$path/");

PHP CURL will connect to the wrong ftp ip/host if the username or password contains an "@" and there is no way to force it using the correct values.



Reproduce code:
---------------
$ftp_user_name = "jo@na";
$ftp_pass "bujona"; 
$ftp_ip = "19.16.144.123";
$ftp_port = "21";
$path = "";

curl_setopt($ch, CURLOPT_URL, "ftp://$ftp_user_name:$ftp_pass@$ftp_ip:$ftp_port$path/");



Expected result:
----------------
PHP CURL connecting to "ftp://jo@na:bujona@19.16.144.123:21"

Actual result:
--------------
PHP CURL uses "na:bujona@19.16.144.123" as ip/hostname

Is there any way to solve this bug?

thank you



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-03 14:41 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See Bug#44456, thanks.
 [2008-08-03 16:20 UTC] jani@php.net
It's expected. Please don't reopen again.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 23:01:28 2024 UTC