mirror of
https://github.com/danog/tgseclib.git
synced 2025-01-21 21:41:14 +01:00
/home and /home/ should return the same thing for rawlist() and nlist() (thanks pioyu!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@167 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
3da6c0d608
commit
38f1bd487f
@ -478,12 +478,12 @@ class Net_SFTP extends Net_SSH2 {
|
||||
// if the SFTP server returned the canonicalized path even for non-existant files this wouldn't be necessary
|
||||
// on OpenSSH it isn't necessary but on other SFTP servers it is. that and since the specs say nothing on
|
||||
// the subject, we'll go ahead and work around it with the following.
|
||||
if ($dir[strlen($dir) - 1] != '/') {
|
||||
if (empty($dir) || $dir[strlen($dir) - 1] != '/') {
|
||||
$file = basename($dir);
|
||||
$dir = dirname($dir);
|
||||
}
|
||||
|
||||
$dir = rtrim($dir, '/');
|
||||
$dir = $dir[0] == '/' ? '/' . rtrim(substr($dir, 1), '/') : rtrim($dir, '/');
|
||||
|
||||
if ($dir == '.' || $dir == $this->pwd) {
|
||||
return $this->pwd . $file;
|
||||
|
Loading…
x
Reference in New Issue
Block a user