mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Do not try to enter passive mode before logging in.
Return error if ftp_nlist() returned error. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9819 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
8e8c40bc75
commit
2bb2e4a43b
1 changed files with 9 additions and 3 deletions
|
@ -316,15 +316,15 @@ class ftp extends transfer
|
||||||
return 'ERR_CONNECTING_SERVER';
|
return 'ERR_CONNECTING_SERVER';
|
||||||
}
|
}
|
||||||
|
|
||||||
// attempt to turn pasv mode on
|
|
||||||
@ftp_pasv($this->connection, true);
|
|
||||||
|
|
||||||
// login to the server
|
// login to the server
|
||||||
if (!@ftp_login($this->connection, $this->username, $this->password))
|
if (!@ftp_login($this->connection, $this->username, $this->password))
|
||||||
{
|
{
|
||||||
return 'ERR_UNABLE_TO_LOGIN';
|
return 'ERR_UNABLE_TO_LOGIN';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// attempt to turn pasv mode on
|
||||||
|
@ftp_pasv($this->connection, true);
|
||||||
|
|
||||||
// change to the root directory
|
// change to the root directory
|
||||||
if (!$this->_chdir($this->root_path))
|
if (!$this->_chdir($this->root_path))
|
||||||
{
|
{
|
||||||
|
@ -462,6 +462,12 @@ class ftp extends transfer
|
||||||
{
|
{
|
||||||
$list = @ftp_nlist($this->connection, $dir);
|
$list = @ftp_nlist($this->connection, $dir);
|
||||||
|
|
||||||
|
// Return on error
|
||||||
|
if ($list === false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove path if prepended
|
// Remove path if prepended
|
||||||
foreach ($list as $key => $item)
|
foreach ($list as $key => $item)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue