From 2a84b76f3062a87c0069da1db2bdca83509882b1 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 22 Jul 2009 02:57:36 +0000 Subject: Fix two potential problems with the ftp_fsock class. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9821 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_transfer.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index c1211eda52..7c5cd329a4 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -737,7 +737,12 @@ class ftp_fsock extends transfer $list = array(); while (!@feof($this->data_connection)) { - $list[] = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); + $filename = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); + + if ($filename !== '') + { + $list[] = $filename; + } } $this->_close_data_connection(); @@ -840,7 +845,7 @@ class ftp_fsock extends transfer $result = @fgets($this->connection, 512); $response .= $result; } - while (substr($response, 3, 1) != ' '); + while (substr($result, 3, 1) !== ' '); if (!preg_match('#^[123]#', $response)) { -- cgit v1.2.1