diff -ur wpsvn/trunk/wp-admin/includes/class-ftp.php wpsvn_patched/trunk/wp-admin/includes/class-ftp.php
--- wpsvn/trunk/wp-admin/includes/class-ftp.php	2010-12-17 14:27:00.000000000 +0400
+++ wpsvn_patched/trunk/wp-admin/includes/class-ftp.php	2010-12-25 16:52:07.000000000 +0400
@@ -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 mb_ereg_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 mb_ereg_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 = mb_ereg_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;
@@ -818,8 +818,8 @@
 	function glob_regexp($pattern,$probe) {
 		$sensitive=(PHP_OS!='WIN32');
 		return ($sensitive?
-			ereg($pattern,$probe):
-			eregi($pattern,$probe)
+			mb_ereg($pattern,$probe):
+			mb_eregi($pattern,$probe)
 		);
 	}
 
diff -ur wpsvn/trunk/wp-admin/includes/class-ftp-pure.php wpsvn_patched/trunk/wp-admin/includes/class-ftp-pure.php
--- wpsvn/trunk/wp-admin/includes/class-ftp-pure.php	2010-12-17 14:27:00.000000000 +0400
+++ wpsvn_patched/trunk/wp-admin/includes/class-ftp-pure.php	2010-12-25 16:51:20.000000000 +0400
@@ -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(",", mb_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));
 			$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);
diff -ur wpsvn/trunk/wp-admin/includes/class-ftp-sockets.php wpsvn_patched/trunk/wp-admin/includes/class-ftp-sockets.php
--- wpsvn/trunk/wp-admin/includes/class-ftp-sockets.php	2010-12-17 14:27:00.000000000 +0400
+++ wpsvn_patched/trunk/wp-admin/includes/class-ftp-sockets.php	2010-12-25 16:49:38.000000000 +0400
@@ -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(",", mb_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));
 			$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);
diff -ur wpsvn/trunk/wp-includes/class-phpmailer.php wpsvn_patched/trunk/wp-includes/class-phpmailer.php
--- wpsvn/trunk/wp-includes/class-phpmailer.php	2010-12-17 14:27:00.000000000 +0400
+++ wpsvn_patched/trunk/wp-includes/class-phpmailer.php	2010-12-25 16:47:42.000000000 +0400
@@ -589,7 +589,7 @@
     /* Retry while there is no connection */
     while($index < count($hosts) && $connection == false) {
       $hostinfo = array();
-      if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
+      if(mb_eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
         $host = $hostinfo[1];
         $port = $hostinfo[2];
       } else {
diff -ur wpsvn/trunk/wp-includes/class-pop3.php wpsvn_patched/trunk/wp-includes/class-pop3.php
--- wpsvn/trunk/wp-includes/class-pop3.php	2010-12-17 14:27:00.000000000 +0400
+++ wpsvn_patched/trunk/wp-includes/class-pop3.php	2010-12-25 16:46:17.000000000 +0400
@@ -252,7 +252,7 @@
         $MsgArray = array();
 
         $line = fgets($fp,$buffer);
-        while ( !ereg("^\.\r\n",$line))
+        while ( !mb_ereg("^\.\r\n",$line))
         {
             $MsgArray[$count] = $line;
             $count++;
@@ -319,7 +319,7 @@
             if($msgC > $Total) { break; }
             $line = fgets($fp,$this->BUFFER);
             $line = $this->strip_clf($line);
-            if(ereg("^\.",$line))
+            if(@mb_ereg("^\.",$line))
             {
                 $this->ERROR = "POP3 pop_list: " . _("Premature end of list");
                 return false;
@@ -365,7 +365,7 @@
         $MsgArray = array();
 
         $line = fgets($fp,$buffer);
-        while ( !ereg("^\.\r\n",$line))
+        while ( !mb_ereg("^\.\r\n",$line))
         {
             if ( $line[0] == '.' ) { $line = substr($line,1); }
             $MsgArray[$count] = $line;
@@ -553,8 +553,8 @@
             $line = "";
             $count = 1;
             $line = fgets($fp,$buffer);
-            while ( !ereg("^\.\r\n",$line)) {
-                if(ereg("^\.\r\n",$line)) {
+            while ( !mb_ereg("^\.\r\n",$line)) {
+                if(mb_ereg("^\.\r\n",$line)) {
                     break;
                 }
                 list ($msg,$msgUidl) = preg_split('/\s+/',$line);
@@ -606,7 +606,7 @@
         if( empty($cmd) )
             return false;
         else
-            return( ereg ("^\+OK", $cmd ) );
+            return( mb_ereg ("^\+OK", $cmd ) );
     }
 
     function strip_clf ($text = "") {
diff -ur wpsvn/trunk/wp-settings.php wpsvn_patched/trunk/wp-settings.php
--- wpsvn/trunk/wp-settings.php	2010-12-17 14:27:01.000000000 +0400
+++ wpsvn_patched/trunk/wp-settings.php	2010-12-25 16:35:51.000000000 +0400
@@ -23,8 +23,14 @@
 // Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
 wp_initial_constants( );
 
-// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
-set_magic_quotes_runtime( 0 );
+// disable magic quotes depending on PHP version
+if (strpos($_SERVER['SERVER_SOFTWARE'], 'PHP/5.3') !== false) {
+	if(get_magic_quotes_runtime()) {
+		set_magic_quotes_runtime(false);}
+	}else{
+		set_magic_quotes_runtime( 0 );
+	}
+
 @ini_set( 'magic_quotes_sybase', 0 );
 
 // Set default timezone in PHP 5.
