Browse Source
normalize sftp path in read and write stream
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/21091/head
Robin Appelman
6 years ago
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
2 changed files with
6 additions and
0 deletions
-
apps/files_external/lib/Lib/Storage/SFTPReadStream.php
-
apps/files_external/lib/Lib/Storage/SFTPWriteStream.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)) { |
|
|
|
|
|
|
|
@ -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)) { |
|
|
|
|