diff options
author | Roland Lezuo <roland.lezuo@chello.at> | 2014-02-11 23:54:14 +0400 |
---|---|---|
committer | Roland Lezuo <roland.lezuo@chello.at> | 2014-02-11 23:54:14 +0400 |
commit | 5047371ae4102be04770b9c96dd08d43f2001988 (patch) | |
tree | aedd8fef1fc7aa3a254d1ec7415a84228b17ae6a /user_external | |
parent | 0df350abb211f2b917d8474bd6d1b856d0ebe521 (diff) |
Fix mangling of username/password containing % char
Diffstat (limited to 'user_external')
-rw-r--r-- | user_external/lib/ftp.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/user_external/lib/ftp.php b/user_external/lib/ftp.php index b94d7fe39..bbc88eaa6 100644 --- a/user_external/lib/ftp.php +++ b/user_external/lib/ftp.php @@ -33,7 +33,8 @@ class OC_User_FTP extends OC_User_Backend{ OCP\Util::writeLog('user_external', 'ERROR: Stream wrapper not available: ' . $this->protocol, OCP\Util::ERROR); 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)) { return $uid; |