Check if the FTP account is rooted to the base of the WordPress install, props DD32, see #7861

git-svn-id: https://develop.svn.wordpress.org/trunk@9118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-10-10 10:40:04 +00:00
parent f88c28ccee
commit 4ab4dbf7aa

View File

@ -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