Bug #78708 [Fbk->NoF]: ftp_login doesn't work with colon (:) in password
| From: | php-bugs at lists dot php dot net | Date: | Sun, 28 Feb 2021 04:22:13 +0000 |
| Subject: | Bug #78708 [Fbk->NoF]: ftp_login doesn't work with colon (:) in password | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232429@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78708&edit=1
ID: 78708
Updated by: php-bugs@lists.php.net
Reported by: julien dot chavee at gmail dot com
Summary: ftp_login doesn't work with colon (:) in password
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: FTP related
Operating System: CentOS
PHP Version: 7.3.10
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2021-02-19 17:31:11] cmb@php.net
After having a closer look, I fail to see why that would fail
(unless the username/password combination is invalid).
ftp_login() just sends the following commands
USER [USERNAME]
PASS abc:def
What would happen if you send these commands via ftp_raw() or via
telnet? Also, can you please inspect the network traffic to see
whether the colon gets mangled somehow? And which FTP server do
you use?
------------------------------------------------------------------------
[2019-10-21 12:21:42] cmb@php.net
Thanks for checking, anyway!
------------------------------------------------------------------------
[2019-10-21 12:13:43] 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 10:02:52] cmb@php.net
Would it work, if you passed the following as $password:
urlencode('abc:def')
------------------------------------------------------------------------
[2019-10-21 09:16:41] 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"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78708&edit=1