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:
dd32
2010-01-14 09:23:53 +00:00
parent 9d2762f279
commit 41e561b941
5 changed files with 24 additions and 19 deletions
@@ -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() {