diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index b501085672..6428425815 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -338,7 +338,8 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } $pwd = @ftp_pwd($this->link); - $chdir = @ftp_chdir($this->link, $path); + if ( ! @ftp_chdir($this->link, $path) ) // Cant change to folder = folder doesnt exist + return false; $list = @ftp_rawlist($this->link, '-a', false); @ftp_chdir($this->link, $pwd);