diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 75847962..9a0213a6 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -679,7 +679,7 @@ class SFTP extends SSH2 } } - if ($path[0] != '/') { + if (!strlen($path) || $path[0] != '/') { $path = $this->pwd . '/' . $path; }