+
+ if ( strpos($this->method, 'ftp') !== false ) {
+ $constant_overrides = array( 'FTP_BASE' => ABSPATH, 'FTP_CONTENT_DIR' => WP_CONTENT_DIR, 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR, 'FTP_LANG_DIR' => WP_LANG_DIR );
+ foreach ( $constant_overrides as $constant => $dir )
+ if ( defined($constant) && $folder === $dir )
+ return trailingslashit(constant($constant));
+ } elseif ( 'direct' == $this->method ) {
+ $folder = str_replace('\\', '/', $folder); //Windows path sanitisation
+ return trailingslashit($folder);
+ }
+
+ $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows drive letter if it's there.
+ $folder = str_replace('\\', '/', $folder); //Windows path sanitisation
+