From 81797b2ca340c48b4ea09c45c249dbc7d7d2be2d Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 10 Oct 2008 10:40:04 +0000 Subject: [PATCH] Check if the FTP account is rooted to the base of the WordPress install, props DD32, see #7861 git-svn-id: http://svn.automattic.com/wordpress/trunk@9118 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-base.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index cc587f5d7..ec6c0cb2e 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -48,7 +48,11 @@ class WP_Filesystem_Base { function abspath() { if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false ) return FTP_BASE; - return $this->find_folder(ABSPATH); + $folder = $this->find_folder(ABSPATH); + //Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare. + if ( ! $folder && $this->is_dir('/wp-includes') ) + $folder = '/'; + return $folder; } /** * Returns the path on the remote filesystem of WP_CONTENT_DIR