#45701 [Opn->Bgs]: curl_setopt and CURLOPT_URL detecting wrong username, password, and host..

From: Date: Sun, 03 Aug 2008 16:20:59 +0000
Subject: #45701 [Opn->Bgs]: curl_setopt and CURLOPT_URL detecting wrong username, password, and host..
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127555@lists.php.net to get a copy of this message
ID: 45701 Updated by: jani@php.net Reported By: sergiocrz at hotmail dot com -Status: Open +Status: Bogus Bug Type: cURL related Operating System: XP PHP Version: 5.2.6 New Comment: It's expected. Please don't reopen again. Previous Comments: ------------------------------------------------------------------------ [2008-08-03 14:41:01] 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 14:30:05] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45701&edit=1

« previous php.bugs (#127555) next »