diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-02 21:42:54 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-02 21:42:54 +0000 |
commit | 98fc394eb350d55c1876ffe8ce02260113af1368 (patch) | |
tree | 154800d957fd61fcac225e679fdbe475627d02b4 /phpBB/includes/functions_transfer.php | |
parent | fdd82e4c124ea2c28ae86b837ba629de206c22a0 (diff) | |
download | forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar.gz forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar.bz2 forums-98fc394eb350d55c1876ffe8ce02260113af1368.tar.xz forums-98fc394eb350d55c1876ffe8ce02260113af1368.zip |
- fixed language pack management a bit (supporting backslashes)
- fixed ftp_fsock, also fixing a reported bug in there
git-svn-id: file:///svn/phpbb/trunk@6139 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_transfer.php')
-rw-r--r-- | phpBB/includes/functions_transfer.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 190447829f..d2cc95f728 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -245,7 +245,7 @@ class ftp extends transfer // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? '' : '/') . $root_path; + $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); // Init some needed values transfer::transfer(); @@ -321,7 +321,7 @@ class ftp extends transfer } /** - * Remove directory (RMDIR) + * Rename file * @access: private */ function _rename($old_handle, $new_handle) @@ -460,7 +460,7 @@ class ftp_fsock extends transfer // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (prefixed with / and no / at the end) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? '' : '/') . $root_path; + $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); // Init some needed values transfer::transfer(); @@ -543,6 +543,16 @@ class ftp_fsock extends transfer } /** + * Rename File + * @access: private + */ + function _rename($old_handle, $new_handle) + { + $this->_send_command('RNFR', $old_handle); + return $this->_send_command('RNTO', $new_handle); + } + + /** * Change current working directory (CHDIR) * @access: private */ @@ -562,7 +572,7 @@ class ftp_fsock extends transfer */ function _chmod($file, $perms) { - return $this->_send_command('SITE CHMOD', $perms . ' ' . $file);; + return $this->_send_command('SITE CHMOD', $perms . ' ' . $file); } /** @@ -579,19 +589,19 @@ class ftp_fsock extends transfer return false; } - $this->_putcmd('STOR', $to_file, false); - // open the connection to send file over if (!$this->_open_data_connection()) { return false; } + $this->_send_command('STOR', $to_file, false); + // send the file $fp = @fopen($from_file, 'rb'); while (!@feof($fp)) { - @fwrite($$this->data_connection, @fread($fp, 4096)); + @fwrite($this->data_connection, @fread($fp, 4096)); } @fclose($fp); @@ -710,7 +720,7 @@ class ftp_fsock extends transfer { return false; } - @stream_set_timeout($$this->data_connection, $this->timeout); + @stream_set_timeout($this->data_connection, $this->timeout); return true; } @@ -721,7 +731,7 @@ class ftp_fsock extends transfer */ function _close_data_connection() { - return @fclose($this->data_connecton); + return @fclose($this->data_connection); } /** |