--- wp-admin/includes/class-wp-filesystem-ftpext.php	2013-03-22 12:02:27.510402799 +0100
+++ wp-admin/includes/class-wp-filesystem-ftpext.php	2013-03-22 12:01:13.593734058 +0100
@@ -47,6 +47,10 @@
 
 		if ( ! empty($opt['base']) )
 			$this->wp_base = $opt['base'];
+		elseif (defined('FTP_BASE'))
+			$this->wp_base = trailingslashit(FTP_BASE);
+			
+		
 
 		// Check if the options provided are OK.
 		if ( empty($opt['username']) )
@@ -84,7 +88,9 @@
 		@ftp_pasv( $this->link, true );
 		if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT )
 			@ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT);
-
+		
+		if(isset($this->wp_base))
+			$this->chdir($this->wp_base);
 		return true;
 	}
 
@@ -140,7 +146,27 @@
 			$cwd = trailingslashit($cwd);
 		return $cwd;
 	}
+	
+	function strict_wp_base($dir) {
+		if($this->wp_base) {
+			$_dir = trailingslashit($dir);
+			if(substr($_dir,0,strlen($this->base))!=$this->wp_base) {
+				if(substr($dir,0,1)!='/') {
+					//make absolute path if is not
+					$cwd = trailingslashit($this->cwd());
+					$_dir = trailingslashit($cwd.$dir);
+				}
+				if(substr($_dir,0,strlen($this->wp_base))!=$this->wp_base) {
+					//if directory doesn't contain in wp_base, add force it
+					$dir = $this->wp_base.$_dir;
+				}
+			} 
+		}
+		return $dir;
+	} 
+	
 	function chdir($dir) {
+		$dir = $this->strict_wp_base($dir);
 		return @ftp_chdir($this->link, $dir);
 	}
 	function chgrp($file, $group, $recursive = false ) {
