From fb20ed8b5b48707f03a7716b5db158a557a1c7f0 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 9 Sep 2013 03:05:01 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/class-wp-filesystem-ssh2.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-filesystem-ssh2.php b/src/wp-admin/includes/class-wp-filesystem-ssh2.php index 93c5526dae..3435b3381d 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/src/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -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;