WP_Filesyste: SSH2 PHP Extension support: Fix a case where defining a custom FS_CHMOD_FILE / FS_CHMOD_DIR constant wouldn't take effect due to chmod() failing with a invalid path. Fixes #23589

git-svn-id: https://develop.svn.wordpress.org/trunk@25306 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-09-09 03:05:01 +00:00
parent beaf91c019
commit fb20ed8b5b
1 changed files with 1 additions and 2 deletions

View File

@ -161,8 +161,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
}
function put_contents($file, $contents, $mode = false ) {
$file = ltrim($file, '/');
$ret = file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
$ret = file_put_contents( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $file, '/' ), $contents );
if ( $ret !== strlen( $contents ) )
return false;