mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-11 22:29:48 +01:00
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
Built from https://develop.svn.wordpress.org/trunk@25306 git-svn-id: http://core.svn.wordpress.org/trunk@25268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7a6fad844a
commit
023a4c7336
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user