aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-07-22 03:02:45 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-07-22 03:02:45 +0000
commit16e393b61d53843dfec3b88257925a0848c027ed (patch)
tree3f0a97338b67c8948352fab1fd4c94f29f80af4b /phpBB
parent2a84b76f3062a87c0069da1db2bdca83509882b1 (diff)
downloadforums-16e393b61d53843dfec3b88257925a0848c027ed.tar
forums-16e393b61d53843dfec3b88257925a0848c027ed.tar.gz
forums-16e393b61d53843dfec3b88257925a0848c027ed.tar.bz2
forums-16e393b61d53843dfec3b88257925a0848c027ed.tar.xz
forums-16e393b61d53843dfec3b88257925a0848c027ed.zip
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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_transfer.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php
index 7c5cd329a4..046abede8e 100644
--- a/phpBB/includes/functions_transfer.php
+++ b/phpBB/includes/functions_transfer.php
@@ -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));
}