Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+9 -9
View File
@@ -2,9 +2,9 @@
/**
* @brief SFTP Class
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 06 May 2013
* @version SVN_VERSION_NUMBER
*/
@@ -26,7 +26,7 @@ class _Sftp extends \IPS\Ftp
/**
* @brief SSH2 Connection resource
*/
protected $ssh2;
protected $ssh;
/**
* @brief FTP Connection resource
@@ -56,18 +56,18 @@ class _Sftp extends \IPS\Ftp
throw new \BadMethodCallException;
}
$this->ssh2 = ssh2_connect( $host, $port );
if ( $this->ssh2 === FALSE )
$this->ssh = ssh2_connect( $host, $port );
if ( $this->ssh === FALSE )
{
throw new \IPS\Ftp\Exception( 'COULD_NOT_CONNECT' );
}
if ( !@ssh2_auth_password( $this->ssh2, $username, $password ) )
if ( !@ssh2_auth_password( $this->ssh, $username, $password ) )
{
throw new \IPS\Ftp\Exception( 'COULD_NOT_LOGIN' );
}
$this->sftp = @ssh2_sftp( $this->ssh2 );
$this->sftp = @ssh2_sftp( $this->ssh );
if ( $this->sftp === FALSE )
{
throw new \IPS\Ftp\Exception( 'COULD_NOT_CONNECT' );
@@ -215,7 +215,7 @@ class _Sftp extends \IPS\Ftp
*/
public function upload( $filename, $file )
{
if ( !@ssh2_scp_send( $this->ssh2, $file, $this->dir . $filename ) )
if ( !@ssh2_scp_send( $this->ssh, $file, $this->dir . $filename ) )
{
throw new \IPS\Ftp\Exception( 'COULD_NOT_UPLOAD' );
}
@@ -239,7 +239,7 @@ class _Sftp extends \IPS\Ftp
$target = tempnam( \IPS\TEMP_DIRECTORY, 'IPS' );
}
if ( !@ssh2_scp_recv( $this->ssh2, $this->dir . $filename, $target ) )
if ( !@ssh2_scp_recv( $this->ssh, $this->dir . $filename, $target ) )
{
throw new \IPS\Ftp\Exception( 'COULD_NOT_DOWNLOAD' );
}