mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
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
This commit is contained in:
parent
81e67fbef1
commit
2a84b76f30
1 changed files with 7 additions and 2 deletions
|
@ -737,7 +737,12 @@ class ftp_fsock extends transfer
|
||||||
$list = array();
|
$list = array();
|
||||||
while (!@feof($this->data_connection))
|
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();
|
$this->_close_data_connection();
|
||||||
|
|
||||||
|
@ -840,7 +845,7 @@ class ftp_fsock extends transfer
|
||||||
$result = @fgets($this->connection, 512);
|
$result = @fgets($this->connection, 512);
|
||||||
$response .= $result;
|
$response .= $result;
|
||||||
}
|
}
|
||||||
while (substr($response, 3, 1) != ' ');
|
while (substr($result, 3, 1) !== ' ');
|
||||||
|
|
||||||
if (!preg_match('#^[123]#', $response))
|
if (!preg_match('#^[123]#', $response))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue