From 629432887e2c964dcaaf1ed48b25b026e874f3c3 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sat, 17 Apr 2010 04:00:59 +0000 Subject: [PATCH] Return false on WP_Filesystem_FTPext::dirlist() for non-existant folders. See #12232. See #12057 git-svn-id: http://svn.automattic.com/wordpress/trunk@14120 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-ftpext.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);