Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/VfsPublic

Commitd47025c

Browse files
committed
lib/Horde/Vfs/Ssh2.php: ssh2_sftp_statinfo() returns boolean false on non-existent files/folders. Avoid accessing those return results as arrays.
1 parent0613ccb commitd47025c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎lib/Horde/Vfs/Ssh2.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function size($path, $name)
101101
$this->_connect();
102102

103103
$statinfo = @ssh2_sftp_stat($this->_sftp,$this->_getPath($path,$name));
104-
if (($size =$statinfo['size']) ===false) {
104+
if ( ($statinfo ===false)or (($size =$statinfo['size']) ===false)) {
105105
thrownewHorde_Vfs_Exception(sprintf('Unable to check file size of "%s".',$this->_getPath($path,$name)));
106106
}
107107

@@ -260,7 +260,7 @@ public function isFolder($path, $name)
260260
/* See if we can stat the remote filename. ANDed with 040000 is true
261261
* if it is a directory. */
262262
$statinfo = @ssh2_sftp_stat($this->_sftp,$this->_getPath($path,$name));
263-
return$statinfo['mode'] &040000;
263+
return($statinfo !==false )and ($statinfo['mode'] &040000 );
264264
}
265265

266266
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp