diff --git a/lib/Horde/Vfs/Ssh2.php b/lib/Horde/Vfs/Ssh2.php index f3e955a..6eae676 100644 --- a/lib/Horde/Vfs/Ssh2.php +++ b/lib/Horde/Vfs/Ssh2.php @@ -101,7 +101,7 @@ public function size($path, $name) $this->_connect(); $statinfo = @ssh2_sftp_stat($this->_sftp, $this->_getPath($path, $name)); - if (($size = $statinfo['size']) === false) { + if ( ($statinfo === false) or (($size = $statinfo['size']) === false) ) { throw new Horde_Vfs_Exception(sprintf('Unable to check file size of "%s".', $this->_getPath($path, $name))); } @@ -260,7 +260,7 @@ public function isFolder($path, $name) /* See if we can stat the remote filename. ANDed with 040000 is true * if it is a directory. */ $statinfo = @ssh2_sftp_stat($this->_sftp, $this->_getPath($path, $name)); - return $statinfo['mode'] & 040000; + return ( $statinfo !== false ) and ( $statinfo['mode'] & 040000 ); } /**