summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTPReadStream.php3
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTPWriteStream.php3
2 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php
index 21ea19517f1..1a721a0e2d8 100644
--- a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php
+++ b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php
@@ -82,6 +82,9 @@ class SFTPReadStream implements File {
public function stream_open($path, $mode, $options, &$opened_path) {
[, $path] = explode('://', $path);
+ $path = '/' . ltrim($path);
+ $path = str_replace('//', '/', $path);
+
$this->loadContext('sftp');
if (!($this->sftp->bitmap & SSH2::MASK_LOGIN)) {
diff --git a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php
index f457992f430..b71dcbb1be5 100644
--- a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php
+++ b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php
@@ -82,6 +82,9 @@ class SFTPWriteStream implements File {
public function stream_open($path, $mode, $options, &$opened_path) {
[, $path] = explode('://', $path);
+ $path = '/' . ltrim($path);
+ $path = str_replace('//', '/', $path);
+
$this->loadContext('sftp');
if (!($this->sftp->bitmap & SSH2::MASK_LOGIN)) {