From 09da29102b1f7fff7b03bb171c3dc383380985c2 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 21 Aug 2015 11:43:25 +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 Built from https://develop.svn.wordpress.org/trunk@33688 git-svn-id: http://core.svn.wordpress.org/trunk@33655 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-ssh2.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-filesystem-ssh2.php b/wp-admin/includes/class-wp-filesystem-ssh2.php index e446656ec1..2b16796591 100644 --- a/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/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 diff --git a/wp-includes/version.php b/wp-includes/version.php index 82918d0592..3f8b619174 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33687'; +$wp_version = '4.4-alpha-33688'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.