Add urlencode to username part of ftp and sftp links
according to #17796
This commit is contained in:
parent
f7140294f2
commit
a6631eceb4
2 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
|
|||
if ($this->secure) {
|
||||
$url.='s';
|
||||
}
|
||||
$url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path;
|
||||
$url.='://'.urlencode($this->user).':'.urlencode($this->password).'@'.$this->host.$this->root.$path;
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ class SFTP extends \OC\Files\Storage\Common {
|
|||
// Do not pass the password here. We want to use the Net_SFTP object
|
||||
// supplied via stream context or fail. We only supply username and
|
||||
// hostname because this might show up in logs (they are not used).
|
||||
$url = 'sftp://'.$this->user.'@'.$this->host.':'.$this->port.$this->root.$path;
|
||||
$url = 'sftp://' . urlencode($this->user) . '@' . $this->host . ':' . $this->port . $this->root . $path;
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue