Author: bantu
Date: Wed Jul 22 01:01:55 2009
New Revision: 9819
Log:
Do not try to enter passive mode before logging in.
Return error if ftp_nlist() returned error.
Modified:
branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Wed Jul 22 01:01:55 2009
***************
*** 316,330 ****
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';
}
// change to the root directory
if (!$this->_chdir($this->root_path))
{
--- 316,330 ----
return 'ERR_CONNECTING_SERVER';
}
// 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,467 ****
--- 462,473 ----
{
$list = @ftp_nlist($this->connection, $dir);
+ // Return on error
+ if ($list === false)
+ {
+ return false;
+ }
+
// Remove path if prepended
foreach ($list as $key => $item)
{
|