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:
Andreas Fischer 2009-07-22 01:01:55 +00:00
parent 8e8c40bc75
commit 2bb2e4a43b

View file

@ -316,15 +316,15 @@ class ftp extends transfer
return 'ERR_CONNECTING_SERVER';
}
// attempt to turn pasv mode on
@ftp_pasv($this->connection, true);
// login to the server
if (!@ftp_login($this->connection, $this->username, $this->password))
{
return 'ERR_UNABLE_TO_LOGIN';
}
// attempt to turn pasv mode on
@ftp_pasv($this->connection, true);
// change to the root directory
if (!$this->_chdir($this->root_path))
{
@ -462,6 +462,12 @@ class ftp extends transfer
{
$list = @ftp_nlist($this->connection, $dir);
// Return on error
if ($list === false)
{
return false;
}
// Remove path if prepended
foreach ($list as $key => $item)
{