Fixed a bug in the XML-RPC library so that if not type is specified, a more intelligent decision is made as to the default type

Also fixed a few formatting problems and updated the eregi() to preg_match() and strncmp().
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php
index 9eb3293..91e3809 100644
--- a/system/libraries/Xmlrpc.php
+++ b/system/libraries/Xmlrpc.php
@@ -231,7 +231,14 @@
 		{

 			if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])]))

 			{

-				$temp = new XML_RPC_Values($value['0'], 'string');

+				if (is_array($value[0]))

+				{

+					$temp = new XML_RPC_Values($value['0'], 'array');

+				}

+				else

+				{

+					$temp = new XML_RPC_Values($value['0'], 'string');

+				}

 			}

 			elseif(is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array'))

 			{

@@ -337,7 +344,7 @@
  * XML-RPC Client class

  *

  * @category	XML-RPC

- * @author		ExpressionEngine Dev Team 

+ * @author		ExpressionEngine Dev Team

  * @link		http://codeigniter.com/user_guide/libraries/xmlrpc.html

  */

 class XML_RPC_Client extends CI_Xmlrpc

@@ -492,7 +499,7 @@
 	

 	function decode($array=FALSE)

 	{

-		$CI =& get_instance();	

+		$CI =& get_instance();

 

 		if ($array !== FALSE && is_array($array))

 		{

@@ -577,7 +584,7 @@
 	{

 		// return a timet in the localtime, or UTC

 		$t = 0;

-		if (ereg("([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})", $time, $regs))

+		if (preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/', $time, $regs))

 		{

 			if ($utc == 1)

 				$t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);

@@ -680,7 +687,7 @@
 		//  Check for HTTP 200 Response

 		//-------------------------------------

 		

-		if(ereg("^HTTP",$data) && !ereg("^HTTP/[0-9\.]+ 200 ", $data))

+		if (strncmp($data, 'HTTP', 4) == 0 && ! preg_match('/^HTTP\/[0-9\.]+ 200 /', $data))

 		{

 			$errstr= substr($data, 0, strpos($data, "\n")-1);

 			$r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']. ' (' . $errstr . ')');

@@ -996,7 +1003,7 @@
 				{

 					// we have a DOUBLE

 					// we must check that only 0123456789-.<space> are characters here

-					if (!ereg("^[+-]?[eE0123456789 \\t\\.]+$", $this->xh[$the_parser]['ac']))

+					if (! preg_match('/^[+-]?[eE0-9\t \.]+$/', $this->xh[$the_parser]['ac']))

 					{

 						$this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND';

 					}

@@ -1009,7 +1016,7 @@
 				{

 					// we have an I4/INT

 					// we must check that only 0123456789-<space> are characters here

-					if (!ereg("^[+-]?[0123456789 \\t]+$", $this->xh[$the_parser]['ac']))

+					if (! preg_match('/^[+-]?[0-9\t ]+$/', $this->xh[$the_parser]['ac']))

 					{

 						$this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND';

 					}

@@ -1062,7 +1069,7 @@
 				}

 			break;

 			case 'METHODNAME':

-				$this->xh[$the_parser]['method'] = ereg_replace("^[\n\r\t ]+", '', $this->xh[$the_parser]['ac']);

+				$this->xh[$the_parser]['method'] = ltrim($this->xh[$the_parser]['ac']);

 			break;

 			case 'PARAMS':

 			case 'FAULT':

@@ -1367,7 +1374,6 @@
 

 	function serializeval($o)

 	{

-		

 		$ar = $o->me;

 		reset($ar);