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

Fixing a ugly notice when using the empty string as parameter for chdir:
  Notice: Uninitialized string offset: -1 in Net/SFTP.php line 617
This commit is contained in:
Julius Beckmann 2013-11-20 14:49:16 +01:00
parent 6f56dfc80b
commit 9ea67f9edb

View File

@ -635,7 +635,8 @@ class Net_SFTP extends Net_SSH2 {
return false;
}
if ($dir[strlen($dir) - 1] != '/') {
// Suffix a slash
if (!$dir || $dir[strlen($dir) - 1] != '/') {
$dir.= '/';
}