From e484373a2b38ddbc8808c5b05f4f849abd5c4c7d Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 5 Jun 2012 23:44:40 -0500 Subject: [PATCH] - updates to _remove directory (thanks, bantu) --- phpseclib/Net/SFTP.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index b161dc5c..6406cc0f 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -835,11 +835,12 @@ class Net_SFTP extends Net_SSH2 { foreach ($dirs as $dir) { if ($dir == end($dirs)) { unset($temp[$dir]); - break; + return true; } - if (isset($new[$key])) { - $temp = &$temp[$dir]; + if (!isset($temp[$dir])) { + return false; } + $temp = &$temp[$dir]; } } @@ -1623,6 +1624,7 @@ class Net_SFTP extends Net_SSH2 { if (!$this->_send_sftp_packet(NET_SFTP_RMDIR, pack('Na*', strlen($path), $path))) { return false; } + $this->_remove_dir($path); $i++;