Commit c2f3cb2b authored by Dries's avatar Dries

- Renamed 'xmlrpc_decode' to '_xmlrpc_decode' to avoid redeclaration when
  PHP's XML-RPC library is enabled.

- Renamed 'xmlrpc_encode' to '_xmlrpc_encode' to avoid redeclaration when
  PHP's XML-RPC library is enabled.

- Removed 'if (funcion_exist("xmlrpc_encode"))' check from common.inc.
parent 2d6408df
......@@ -962,10 +962,7 @@ function page_footer() {
include_once "includes/theme.inc";
include_once "includes/pager.inc";
include_once "includes/menu.inc";
if (!function_exists("xmlrpc_decode")) {
include_once "includes/xmlrpc.inc";
}
include_once "includes/xmlrpc.inc";
// initialize configuration variables, using values from conf.php if available:
$conf = variable_init(isset($conf) ? $conf : array());
......
......@@ -1008,13 +1008,13 @@ function iso8601_decode($idate, $utc=0) {
return $t;
}
/****************************************************************
* xmlrpc_decode takes a message in PHP xmlrpc object format and *
/*****************************************************************
* _xmlrpc_decode takes a message in PHP xmlrpc object format and *
* tranlates it into native PHP types. *
* *
* author: Dan Libby (dan@libby.com) *
****************************************************************/
function xmlrpc_decode($xmlrpc_val) {
*****************************************************************/
function _xmlrpc_decode($xmlrpc_val) {
$kind = $xmlrpc_val->kindOf();
if($kind == "scalar") {
......@@ -1025,7 +1025,7 @@ function xmlrpc_decode($xmlrpc_val) {
$arr = array();
for($i = 0; $i < $size; $i++) {
$arr[]=xmlrpc_decode($xmlrpc_val->arraymem($i));
$arr[]=_xmlrpc_decode($xmlrpc_val->arraymem($i));
}
return $arr;
}
......@@ -1034,14 +1034,14 @@ function xmlrpc_decode($xmlrpc_val) {
$arr = array();
while(list($key,$value)=$xmlrpc_val->structeach()) {
$arr[$key] = xmlrpc_decode($value);
$arr[$key] = _xmlrpc_decode($value);
}
return $arr;
}
}
/****************************************************************
* xmlrpc_encode takes native php types and encodes them into *
* _xmlrpc_encode takes native php types and encodes them into *
* xmlrpc PHP object format. *
* BUG: All sequential arrays are turned into structs. I don't *
* know of a good way to determine if an array is sequential *
......@@ -1052,7 +1052,7 @@ function xmlrpc_decode($xmlrpc_val) {
* *
* author: Dan Libby (dan@libby.com) *
****************************************************************/
function xmlrpc_encode($php_val) {
function _xmlrpc_encode($php_val) {
global $xmlrpcInt;
global $xmlrpcDouble;
global $xmlrpcString;
......@@ -1068,7 +1068,7 @@ function xmlrpc_encode($php_val) {
case "object":
$arr = array();
while (list($k,$v) = each($php_val)) {
$arr[$k] = xmlrpc_encode($v);
$arr[$k] = _xmlrpc_encode($v);
}
$xmlrpc_val->addStruct($arr);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment