Index: wp-admin/includes/class-ftp-pure.php
===================================================================
--- wp-admin/includes/class-ftp-pure.php	(revision 17693)
+++ wp-admin/includes/class-ftp-pure.php	(working copy)
@@ -110,7 +110,7 @@
 				$this->_data_close();
 				return FALSE;
 			}
-			$ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
+			$ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$/", "\\1", $this->_message));
 			$this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
             $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
 			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
Index: wp-admin/includes/class-ftp-sockets.php
===================================================================
--- wp-admin/includes/class-ftp-sockets.php	(revision 17693)
+++ wp-admin/includes/class-ftp-sockets.php	(working copy)
@@ -131,7 +131,7 @@
 				$this->_data_close();
 				return FALSE;
 			}
-			$ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
+			$ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$/", "\\1", $this->_message));
 			$this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
             $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
 			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
Index: wp-admin/includes/class-ftp.php
===================================================================
--- wp-admin/includes/class-ftp.php	(revision 17693)
+++ wp-admin/includes/class-ftp.php	(working copy)
@@ -380,7 +380,7 @@
 	function pwd() {
 		if(!$this->_exec("PWD", "pwd")) return FALSE;
 		if(!$this->_checkCode()) return FALSE;
-		return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message);
+		return preg_replace("/^[0-9]{3} \"(.+)\".+/", "\\1", $this->_message);
 	}
 
 	function cdup() {
@@ -424,7 +424,7 @@
 		}
 		if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
 		if(!$this->_checkCode()) return FALSE;
-		return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
+		return preg_replace("/^[0-9]{3} ([0-9]+)".CRLF.'/', "\\1", $this->_message);
 	}
 
 	function abort() {
@@ -444,7 +444,7 @@
 		}
 		if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;
 		if(!$this->_checkCode()) return FALSE;
-		$mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
+		$mdtm = preg_replace("/^[0-9]{3} ([0-9]+)".CRLF.'/', "\\1", $this->_message);
 		$date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
 		$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
 		return $timestamp;
@@ -807,7 +807,7 @@
 						str_replace('?','.{1,1}',$pattern))));
 			$out[]=$pattern;
 		}
-		if(count($out)==1) return($this->glob_regexp("^$out[0]$",$string));
+		if(count($out)==1) return($this->glob_regexp("/^$out[0]$/",$string));
 		else {
 			foreach($out as $tester)
 				if($this->my_regexp("^$tester$",$string)) return true;
@@ -816,11 +816,8 @@
 	}
 
 	function glob_regexp($pattern,$probe) {
-		$sensitive=(PHP_OS!='WIN32');
-		return ($sensitive?
-			ereg($pattern,$probe):
-			eregi($pattern,$probe)
-		);
+		$sensitive = ( PHP_OS != 'WIN32' ) ? '' : 'i';
+		return preg_match( $pattern . $sensitive, $probe );
 	}
 
 	function dirlist($remote) {
