From b70cb8764179060dff71969b1a41f7df76f0b3b6 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 19 Nov 2016 20:39:05 -0600 Subject: [PATCH] SFTP: don't delete directory if $path is empty --- phpseclib/Net/SFTP.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index a279bdfb..d5404994 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2237,6 +2237,10 @@ class Net_SFTP extends Net_SSH2 return false; } + if (empty($path)) { + return false; + } + $path = $this->_realpath($path); if ($path === false) { return false;