Skip to content

[Backport] FIXED: FTP user and password strings urldecoded #17247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 31, 2018
Merged

[Backport] FIXED: FTP user and password strings urldecoded #17247

merged 2 commits into from
Jul 31, 2018

Conversation

mage2pratik
Copy link
Contributor

Original Pull Request

#16876

Description

FTP connections can't use user or password strings with special characters, like @ or #.
$user = '[email protected]';
$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

  1. $ftp->connect("ftp://my%23mail.com:[email protected]"); // this works
  2. $ftp->connect("ftp://no_special_chars:[email protected]"); // this works too

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-2569 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @mage2pratik. Thank you for your contribution.
We will aim to release these changes as part of 2.1.15.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants