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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Thu Aug 06 00:01:26 2020 UTC