Merge pull request #1662 from iroli1/master

Fix mangling of username/password containing % char
This commit is contained in:
Thomas Müller
2014-02-26 07:02:27 +01:00

View File

@@ -52,7 +52,8 @@ class OC_User_FTP extends \OCA\user_external\Base{
);
return false;
}
$url = sprintf('%s://%s:%s@%s/', $this->protocol, $uid, $password, $this->host);
// opendir handles the as %-encoded string, but this is not true for usernames and passwords, encode them before passing them
$url = sprintf('%s://%s:%s@%s/', $this->protocol, urlencode($uid), urlencode($password), $this->host);
$result=@opendir($url);
if(is_resource($result)) {
$this->storeUser($uid);