mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 13:28:27 +00:00
- make it so size() doesn't give an E_NOTICE if the size attribute isn't present
- make delete() recursive by default - fix a bug that prevented inbound packets from being logged git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@192 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
257b18501e
commit
8e0845f411
@ -1005,7 +1005,10 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
function _size($filename)
|
function _size($filename)
|
||||||
{
|
{
|
||||||
$result = $this->_stat($filename, NET_SFTP_LSTAT);
|
$result = $this->_stat($filename, NET_SFTP_LSTAT);
|
||||||
return $result === false ? false : $result['size'];
|
if ($result === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return isset($result['size']) ? $result['size'] : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1532,7 +1535,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
* @return Boolean
|
* @return Boolean
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function delete($path, $recursive = false)
|
function delete($path, $recursive = true)
|
||||||
{
|
{
|
||||||
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
|
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1872,7 +1875,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
} else {
|
} else {
|
||||||
$this->packet_type_log[] = $packet_type;
|
$this->packet_type_log[] = $packet_type;
|
||||||
if (NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX) {
|
if (NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX) {
|
||||||
$this->packet_log[] = $data;
|
$this->packet_log[] = $packet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user