php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78708 ftp_login doesn't work with colon (:) in password
Submitted: 2019-10-21 09:16 UTC Modified: 2019-10-21 12:21 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: julien dot chavee at gmail dot com Assigned:
Status: Open Package: FTP related
PHP Version: 7.3.10 OS: CentOS
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: julien dot chavee at gmail dot com
New email:
PHP Version: OS:

 

 [2019-10-21 09:16 UTC] julien dot chavee at gmail dot com
Description:
------------
The PHP function ftp_login() return false with the following warning when the password contains the character colon (:):

"PHP Warning:  ftp_login(): 500"

Test script:
---------------
<?php
$connection = ftp_connect(
	'[SERVER]',
	'[PORT]',
	'[TIMEOUT]'
);

if($connection !== false) {
	$login = ftp_login(
		$connection,
		'[USERNAME]',
		'abc:def'
);

if($login === true) {
	echo 'Success';
} else {
	echo 'Failed';
}

Expected result:
----------------
Display 'Success'

Actual result:
--------------
Display 'Failed' with the warning "PHP Warning:  ftp_login(): 500"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-21 10:02 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-10-21 10:02 UTC] cmb@php.net
Would it work, if you passed the following as $password:

  urlencode('abc:def')
 [2019-10-21 12:13 UTC] julien dot chavee at gmail dot com
Hello,

I tried but unfortunately it doesn't work. The warning is not the same but we still can't connect:

"PHP Warning:  ftp_login(): Login authentication failed"
 [2019-10-21 12:21 UTC] cmb@php.net
-Status: Feedback +Status: Open -Assigned To: cmb +Assigned To:
 [2019-10-21 12:21 UTC] cmb@php.net
Thanks for checking, anyway!
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 07:01:25 2020 UTC