From d9c526530322c5d19240df4a4c223c36e767af44 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 6 Sep 2013 08:28:59 +0000 Subject: [PATCH] WP_Filesystem: FTP Sockets: Avoid using the file_exists() / is_exists() / exists() PemFTP functionality as it's buggy on ncFTPd servers, switching to listing the file instead which is what we use for the FTP Extension transport. Fixes #14049 git-svn-id: https://develop.svn.wordpress.org/trunk@25274 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-filesystem-ftpsockets.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php index 728385b70b..dedb30cad9 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -219,8 +219,10 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { return $this->ftp->mdel($file); } - function exists($file) { - return $this->ftp->is_exists($file); + function exists( $file ) { + $list = $this->ftp->nlist( $file ); + 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 } function is_file($file) {