Standardise WP_Filesystem_*::put_contents() arguments to support chmod reliably across all transports. Fixes #10889
git-svn-id: http://svn.automattic.com/wordpress/trunk@12723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -160,9 +160,13 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
return file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
}
|
||||
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
function put_contents($file, $contents, $mode = false ) {
|
||||
$file = ltrim($file, '/');
|
||||
return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
|
||||
$ret = file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
|
||||
|
||||
$this->chmod($file, $mode);
|
||||
|
||||
return false !== $ret;
|
||||
}
|
||||
|
||||
function cwd() {
|
||||
|
||||
Reference in New Issue
Block a user