From: Andreas F. <ba...@ph...> - 2009-07-22 02:58:07
|
Author: bantu Date: Wed Jul 22 02:57:36 2009 New Revision: 9821 Log: Fix two potential problems with the ftp_fsock class. 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 02:57:36 2009 *************** *** 737,743 **** $list = array(); while (!@feof($this->data_connection)) { ! $list[] = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); } $this->_close_data_connection(); --- 737,748 ---- $list = array(); while (!@feof($this->data_connection)) { ! $filename = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); ! ! if ($filename !== '') ! { ! $list[] = $filename; ! } } $this->_close_data_connection(); *************** *** 840,846 **** $result = @fgets($this->connection, 512); $response .= $result; } ! while (substr($response, 3, 1) != ' '); if (!preg_match('#^[123]#', $response)) { --- 845,851 ---- $result = @fgets($this->connection, 512); $response .= $result; } ! while (substr($result, 3, 1) !== ' '); if (!preg_match('#^[123]#', $response)) { |