From 2bb2e4a43b30bd3a686106865c84786de42d50e8 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 22 Jul 2009 01:01:55 +0000 Subject: 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 --- phpBB/includes/functions_transfer.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_transfer.php') diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index c345f81e1d..2146d5fa0b 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -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) { -- cgit v1.2.1