aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_transfer.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:05:39 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:05:39 +0100
commita45bca7c49623341ae971d4e1014ba9de38de982 (patch)
treea1f033124b14c020e850525a6ea745cb7cb3dbab /phpBB/includes/functions_transfer.php
parent1f3498c0d6a20a08fe17948b32fc435f85a6eff8 (diff)
parent6485d66743d55aeba95aed86fcde4a0e555e3104 (diff)
downloadforums-a45bca7c49623341ae971d4e1014ba9de38de982.tar
forums-a45bca7c49623341ae971d4e1014ba9de38de982.tar.gz
forums-a45bca7c49623341ae971d4e1014ba9de38de982.tar.bz2
forums-a45bca7c49623341ae971d4e1014ba9de38de982.tar.xz
forums-a45bca7c49623341ae971d4e1014ba9de38de982.zip
Merge commit 'release-3.0.5-RC1'
Diffstat (limited to 'phpBB/includes/functions_transfer.php')
-rw-r--r--phpBB/includes/functions_transfer.php39
1 files changed, 37 insertions, 2 deletions
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php
index 2925a2df77..c345f81e1d 100644
--- a/phpBB/includes/functions_transfer.php
+++ b/phpBB/includes/functions_transfer.php
@@ -206,7 +206,7 @@ class transfer
$directory = $this->root_path . str_replace($phpbb_root_path, '', $directory);
$this->_chdir($directory);
- $result = $this->_ls('');
+ $result = $this->_ls();
if ($result !== false && is_array($result))
{
@@ -460,7 +460,24 @@ class ftp extends transfer
*/
function _ls($dir = './')
{
- return @ftp_nlist($this->connection, $dir);
+ $list = @ftp_nlist($this->connection, $dir);
+
+ // Remove path if prepended
+ foreach ($list as $key => $item)
+ {
+ // Use same separator for item and dir
+ $item = str_replace('\\', '/', $item);
+ $dir = str_replace('\\', '/', $dir);
+
+ if (strpos($item, $dir) === 0)
+ {
+ $item = substr($item, strlen($dir));
+ }
+
+ $list[$key] = $item;
+ }
+
+ return $list;
}
/**
@@ -710,6 +727,24 @@ class ftp_fsock extends transfer
}
$this->_close_data_connection();
+ // Clear buffer
+ $this->_check_command();
+
+ // Remove path if prepended
+ foreach ($list as $key => $item)
+ {
+ // Use same separator for item and dir
+ $item = str_replace('\\', '/', $item);
+ $dir = str_replace('\\', '/', $dir);
+
+ if (strpos($item, $dir) === 0)
+ {
+ $item = substr($item, strlen($dir));
+ }
+
+ $list[$key] = $item;
+ }
+
return $list;
}