summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-31 23:18:10 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-31 23:18:10 +0200
commit690eef26ddaa953be763019a09d79e980e6bcdf1 (patch)
treeaed499e8f34974fe123624633e31fd40facf9142 /apps/files_external
parent2714dfce21fa517e3056865d4f2a7d5c24276a43 (diff)
parenta6631eceb47e14102ce91bcb274abe75a520235d (diff)
downloadnextcloud-server-690eef26ddaa953be763019a09d79e980e6bcdf1.tar.gz
nextcloud-server-690eef26ddaa953be763019a09d79e980e6bcdf1.zip
Merge pull request #23274 from Senorsen/add-urlencode-ftp-sftp
Add urlencode to username part of ftp and sftp links
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/ftp.php2
-rw-r--r--apps/files_external/lib/sftp.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 338e2c14fa4..7249aeceb5d 100644
--- a/apps/files_external/lib/ftp.php
+++ b/apps/files_external/lib/ftp.php
@@ -78,7 +78,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;
}
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index c44ee9f908e..a6984f3b4e0 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -461,7 +461,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;
}
}