diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 5356ffbf..5ebf9d28 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -635,6 +635,11 @@ class Net_SFTP extends Net_SSH2 { return false; } + if ($dir === '') { + $dir = './'; + } + + // Suffix a slash if needed if ($dir[strlen($dir) - 1] != '/') { $dir.= '/'; }