mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Also fix bug #46295 in ftp_fsock class.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9822 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
2a84b76f30
commit
16e393b61d
1 changed files with 16 additions and 2 deletions
|
@ -483,7 +483,7 @@ class ftp extends transfer
|
|||
$item = str_replace('\\', '/', $item);
|
||||
$dir = str_replace('\\', '/', $dir);
|
||||
|
||||
if (strpos($item, $dir) === 0)
|
||||
if (!empty($dir) && strpos($item, $dir) === 0)
|
||||
{
|
||||
$item = substr($item, strlen($dir));
|
||||
}
|
||||
|
@ -749,6 +749,20 @@ class ftp_fsock extends transfer
|
|||
// Clear buffer
|
||||
$this->_check_command();
|
||||
|
||||
// See bug #46295 - Some FTP daemons don't like './'
|
||||
if ($dir === './' && empty($list))
|
||||
{
|
||||
// Let's try some alternatives
|
||||
$list = $this->_ls('.');
|
||||
|
||||
if (empty($list))
|
||||
{
|
||||
$list = $this->_ls('');
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
// Remove path if prepended
|
||||
foreach ($list as $key => $item)
|
||||
{
|
||||
|
@ -756,7 +770,7 @@ class ftp_fsock extends transfer
|
|||
$item = str_replace('\\', '/', $item);
|
||||
$dir = str_replace('\\', '/', $dir);
|
||||
|
||||
if (strpos($item, $dir) === 0)
|
||||
if (!empty($dir) && strpos($item, $dir) === 0)
|
||||
{
|
||||
$item = substr($item, strlen($dir));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue