Standardise WP_Filesystem_*::put_contents() arguments to support chmod reliably across all transports. Fixes #10889

git-svn-id: https://develop.svn.wordpress.org/trunk@12723 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-01-14 09:23:53 +00:00
parent c1f8977b95
commit 76592af8d8
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() {