diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index e39fabed..59c760ba 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -778,7 +778,7 @@ class Net_SFTP extends Net_SSH2 } } - if ($path[0] != '/') { + if (!strlen($path) || $path[0] != '/') { $path = $this->pwd . '/' . $path; }