From 3b56c695e23fd1407902483ce65b62631ec9cf59 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 25 Jun 2013 16:37:20 -0500 Subject: [PATCH] SFTP: get() didn't return data --- phpseclib/Net/SFTP.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index cd5ce96b..9249421c 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1714,7 +1714,12 @@ class Net_SFTP extends Net_SSH2 { fclose($fp); } - return $this->_close_handle($handle); + if (!$this->_close_handle($handle)) { + return false; + } + + // if $content isn't set that means a file was written to + return isset($content) ? $content : true; } /**