merging fixes by Mark Ghosh for service pings
git-svn-id: http://svn.automattic.com/wordpress/trunk@1279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
620accf191
commit
c9ad4c9437
|
@ -775,7 +775,27 @@ class xmlrpcval {
|
||||||
var $mytype=0;
|
var $mytype=0;
|
||||||
|
|
||||||
function xmlrpcval($val=-1, $type="") {
|
function xmlrpcval($val=-1, $type="") {
|
||||||
global $xmlrpcTypes;
|
global $xmlrpcTypes;
|
||||||
|
// but this doesn't work, so we redefine it. WEIRD BUG ALERT
|
||||||
|
$xmlrpcI4="i4";
|
||||||
|
$xmlrpcInt="int";
|
||||||
|
$xmlrpcBoolean="boolean";
|
||||||
|
$xmlrpcDouble="double";
|
||||||
|
$xmlrpcString="string";
|
||||||
|
$xmlrpcDateTime="dateTime.iso8601";
|
||||||
|
$xmlrpcBase64="base64";
|
||||||
|
$xmlrpcArray="array";
|
||||||
|
$xmlrpcStruct="struct";
|
||||||
|
$xmlrpcTypes=array($xmlrpcI4 => 1,
|
||||||
|
$xmlrpcInt => 1,
|
||||||
|
$xmlrpcBoolean => 1,
|
||||||
|
$xmlrpcString => 1,
|
||||||
|
$xmlrpcDouble => 1,
|
||||||
|
$xmlrpcDateTime => 1,
|
||||||
|
$xmlrpcBase64 => 1,
|
||||||
|
$xmlrpcArray => 2,
|
||||||
|
$xmlrpcStruct => 3);
|
||||||
|
// print_r($xmlrpcTypes);
|
||||||
$this->me=array();
|
$this->me=array();
|
||||||
$this->mytype=0;
|
$this->mytype=0;
|
||||||
if ($val!=-1 || $type!="") {
|
if ($val!=-1 || $type!="") {
|
||||||
|
@ -1058,7 +1078,7 @@ function iso8601_decode($idate, $utc=0) {
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
if (!function_exists('phpxmlrpc_decode')) {
|
if (!function_exists('phpxmlrpc_decode')) {
|
||||||
function phpxmlrpc_decode($xmlrpc_val) {
|
function phpxmlrpc_decode($xmlrpc_val) {
|
||||||
$kind = $xmlrpc_val->kindOf();
|
$kind = @$xmlrpc_val->kindOf();
|
||||||
|
|
||||||
if($kind == "scalar") {
|
if($kind == "scalar") {
|
||||||
return $xmlrpc_val->scalarval();
|
return $xmlrpc_val->scalarval();
|
||||||
|
|
|
@ -503,28 +503,30 @@ function weblog_ping($server = '', $path = '') {
|
||||||
$c = new xmlrpc_client($path, $server, 80);
|
$c = new xmlrpc_client($path, $server, 80);
|
||||||
$r = $c->send($f);
|
$r = $c->send($f);
|
||||||
|
|
||||||
if ($debug) {
|
if ('0' != $r) {
|
||||||
echo "<h3>Response Object Dump:</h3>
|
if ($debug) {
|
||||||
<pre>\n";
|
echo "<h3>Response Object Dump:</h3>
|
||||||
print_r($r);
|
<pre>\n";
|
||||||
echo "</pre>\n";
|
print_r($r);
|
||||||
}
|
echo "</pre>\n";
|
||||||
|
}
|
||||||
|
|
||||||
$v = @phpxmlrpc_decode($r->value());
|
$v = @phpxmlrpc_decode($r->value());
|
||||||
if (!$r->faultCode()) {
|
if (!$r->faultCode()) {
|
||||||
$result['message'] = "<p class=\"rpcmsg\">";
|
$result['message'] = "<p class=\"rpcmsg\">";
|
||||||
$result['message'] = $result['message'] . $v["message"] . "<br />\n";
|
$result['message'] = $result['message'] . $v["message"] . "<br />\n";
|
||||||
$result['message'] = $result['message'] . "</p>";
|
$result['message'] = $result['message'] . "</p>";
|
||||||
} else {
|
} else {
|
||||||
$result['err'] = $r->faultCode();
|
$result['err'] = $r->faultCode();
|
||||||
$result['message'] = "<!--\n";
|
$result['message'] = "<!--\n";
|
||||||
$result['message'] = $result['message'] . "Fault: ";
|
$result['message'] = $result['message'] . "Fault: ";
|
||||||
$result['message'] = $result['message'] . "Code: " . $r->faultCode();
|
$result['message'] = $result['message'] . "Code: " . $r->faultCode();
|
||||||
$result['message'] = $result['message'] . " Reason '" .$r->faultString()."'<BR>";
|
$result['message'] = $result['message'] . " Reason '" .$r->faultString()."'<BR>";
|
||||||
$result['message'] = $result['message'] . "-->\n";
|
$result['message'] = $result['message'] . "-->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($debug) print '<blockquote>' . $result['message'] . '</blockquote>';
|
if ($debug) print '<blockquote>' . $result['message'] . '</blockquote>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generic_ping($post_id = 0) {
|
function generic_ping($post_id = 0) {
|
||||||
|
|
Loading…
Reference in New Issue