diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 305f316e34..571b23cb47 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -289,6 +289,8 @@ p a {
[Fix] MS SQL DBAL drivers now write over extension limitations, they are too low for most installations (Bug #12415)
[Fix] Fix sorting by author on "unanswered posts" (Bug #12545)
[Fix] Allow searching for multibyte authors (Bug #11793)
+ [Fix] Writing directories/files with correct permissions using FTP for transfers on PHP4
+
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php
index 51a7fa8bb7..2a38c8c7ad 100644
--- a/phpBB/includes/functions_transfer.php
+++ b/phpBB/includes/functions_transfer.php
@@ -382,7 +382,9 @@ class ftp extends transfer
}
else
{
- $chmod_cmd = 'CHMOD ' . $perms . ' ' . $file;
+ // Unfortunatly CHMOD is not expecting an octal value...
+ // We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;)
+ $chmod_cmd = 'CHMOD ' . base_convert($perms, 10, 8) . ' ' . $file;
$err = $this->_site($chmod_cmd);
}
@@ -605,7 +607,9 @@ class ftp_fsock extends transfer
*/
function _chmod($file, $perms)
{
- return $this->_send_command('SITE CHMOD', $perms . ' ' . $file);
+ // Unfortunatly CHMOD is not expecting an octal value...
+ // We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;)
+ return $this->_send_command('SITE CHMOD', base_convert($perms, 10, 8) . ' ' . $file);
}
/**