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

Commit08b96b1

Browse files
authored
Merge pull request#1 from sunweaver/pr/various-ssh2-fixes
Horde_Vfs: Various SSH2 driver fixes
2 parentsf88615f +d47025c commit08b96b1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎lib/Horde/Vfs/Ssh2.php‎

Lines changed: 4 additions & 8 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
/**
@@ -865,12 +865,8 @@ protected function _recv($remote, $local)
865865
*/
866866
protectedfunction_wrap($remote)
867867
{
868-
$wrapper ='ssh2.sftp://' .$this->_params['username'] .':'
869-
.$this->_params['password'] .'@' .$this->_params['hostspec'];
870-
if (!empty($this->_params['port'])) {
871-
$wrapper .=':' .$this->_params['port'];
872-
}
873-
if ($remote{0} !='/') {
868+
$wrapper ='ssh2.sftp://' .intval($this->_sftp);
869+
if ($remote[0] !='/') {
874870
$remote =$this->getCurrentDirectory() .'/' .$remote;
875871
}
876872
return$wrapper .$remote;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp