From 466500743faabf1a66fcfa7448cfc36ac0b495ce Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 21 Aug 2015 11:42:04 +0000 Subject: [PATCH] WP_Filesystem: SSH2 handler: Remove support for is_writable() via SSH, it turns out PHP doesn't verify the writability via SFTP and instead uses a comparison based on the current php system process user instead of the ssh user. This fixes the 'The update cannot be installed because we will be unable to copy some files.' error encountered during updates by skipping the write test completely. Props jobst. Fixes #33480 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@33688 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-filesystem-ssh2.php | 4 ++-- 1 file changed, 2 insertions(+), 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 e446656ec1..2b16796591 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/src/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -383,8 +383,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { * @return bool */ public function is_writable($file) { - $file = ltrim($file, '/'); - return is_writable('ssh2.sftp://' . $this->sftp_link . '/' . $file); + // PHP will base it's writable checks on system_user === file_owner, not ssh_user === file_owner + return true; } /** * @param string $file