Making Net_SFTP::chdir capable of handling the empty string.

Updated patch after hint from bantu.
This commit is contained in:
Julius Beckmann 2013-11-20 15:08:50 +01:00
parent 9ea67f9edb
commit 44078e5f40

View File

@ -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.= '/';
}