mirror of
https://github.com/nextcloud/server.git
synced 2026-02-21 00:45:24 -05:00
normalize sftp path in read and write stream
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
d26169838e
commit
6f2e920a5b
2 changed files with 6 additions and 0 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue