diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index 109acc16ff..f9f46e7c81 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -275,6 +275,11 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { */ public function exists($file) { $list = @ftp_nlist($this->link, $file); + + if ( empty( $list ) && $this->is_dir( $file ) ) { + return true; // File is an empty directory. + } + return !empty($list); //empty list = no file, so invert. } /** diff --git a/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/wp-admin/includes/class-wp-filesystem-ftpsockets.php index a2b3cada88..ec85d36b7b 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -274,6 +274,11 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { */ public function exists( $file ) { $list = $this->ftp->nlist( $file ); + + if ( empty( $list ) && $this->is_dir( $file ) ) { + return true; // File is an empty directory. + } + return !empty( $list ); //empty list = no file, so invert. // Return $this->ftp->is_exists($file); has issues with ABOR+426 responses on the ncFTPd server. } diff --git a/wp-includes/version.php b/wp-includes/version.php index 180fd9eb05..a56a153ffb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta1-31814'; +$wp_version = '4.2-beta1-31815'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.