FIXED: FTP user and password strings urldecoded#16876
Conversation
|
Hi @javierperezm. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
|
Hi @javierperezm, Can you check Code Standars error in Travis. The PR looks like OK, but we should solve the problem with Coding Standars before. |
recoding to pass travis coding standards
|
@osrecio I don't understand the Travis response... the warnings are placed outside my changes, and even outside the class I patched |
|
@javierperezm Now the Travis is green, without Code Standard issues. I will review ASAP. |
|
@javierperezm thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
|
Hi @aleron75, thank you for the review. |
|
Once merged, don't forget you can easily backport this PR to 2.2 with the Porting Tool, read more here. |
|
Hi @javierperezm. Thank you for your contribution. |
Description
FTP connections can't use user or password strings with special characters, like @ or #.
$user = 'my@mail.com';
$pass = '#my@pass';
$host = 'ftphost.com';
$ftp->connect("ftp://{$user}:{$pass}@{$host}");
connect() calls parse_url() and this will break down bad the special chars...
Solution:
// ...
$user = urlencode($user);
$pass = urlencode($pass);
$ftp->connect( ... );
But connect() method calls ftp_login() without decode the $user and $pass vars
Manual testing scenarios
Contribution checklist