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