class IXR_Value {
var $data;
var $type;
+
function IXR_Value ($data, $type = false) {
$this->data = $data;
if (!$type) {
}
}
}
+
function calculateType() {
if ($this->data === true || $this->data === false) {
return 'boolean';
return 'array';
}
}
+
function getXml() {
/* Return XML for this value */
switch ($this->type) {
}
return false;
}
+
function isStruct($array) {
/* Nasty function to check if an array is a struct or not */
$expected = 0;
return true;
}
function tag_open($parser, $tag, $attr) {
- $this->_currentTagContents = '';
+ $this->_currentTagContents = '';
$this->currentTag = $tag;
switch($tag) {
case 'methodCall':
$this->params[] = $value;
}
}
- $this->_currentTagContents = '';
+ $this->_currentTagContents = '';
}
}
}
function call($methodname, $args) {
if (!$this->hasMethod($methodname)) {
- return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
+ return new IXR_Error(-32601, 'server error. requested method '.
+ $methodname.' does not exist.');
}
$method = $this->callbacks[$methodname];
// Perform the callback and send the response
// It's a class method - check it exists
$method = substr($method, 5);
if (!method_exists($this, $method)) {
- return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
+ return new IXR_Error(-32601, 'server error. requested class method "'.
+ $method.'" does not exist.');
}
// Call the method
$result = $this->$method($args);
} else {
// It's a function - does it exist?
if (is_array($method)) {
- if (!method_exists($method[0], $method[1])) {
- return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
- }
+ if (!method_exists($method[0], $method[1])) {
+ return new IXR_Error(-32601, 'server error. requested object method "'.
+ $method[1].'" does not exist.');
+ }
} else if (!function_exists($method)) {
- return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
+ return new IXR_Error(-32601, 'server error. requested function "'.
+ $method.'" does not exist.');
}
// Call the function
$result = call_user_func($method, $args);
var $response;
var $message = false;
var $debug = false;
- var $timeout;
+ var $timeout;
// Storage place for an error message
var $error = false;
function IXR_Client($server, $path = false, $port = 80, $timeout = false) {
$this->path = $path;
$this->port = $port;
}
- $this->useragent = 'Incutio XML-RPC';
- $this->timeout = $timeout;
+ $this->useragent = 'The Incutio XML-RPC PHP Library';
+ $this->timeout = $timeout;
}
function query() {
$args = func_get_args();
$gettingHeaders = false;
}
if (!$gettingHeaders) {
- $contents .= trim($line)."\n";
+ $contents .= trim($line);
}
}
if ($this->debug) {
var $message;
function IXR_Error($code, $message) {
$this->code = $code;
+ // WP adds htmlspecialchars(). See #5666
$this->message = htmlspecialchars($message);
}
function getXml() {
var $hour;
var $minute;
var $second;
+ var $timezone;
function IXR_Date($time) {
// $time can be a PHP timestamp or an ISO one
if (is_numeric($time)) {
$this->hour = date('H', $timestamp);
$this->minute = date('i', $timestamp);
$this->second = date('s', $timestamp);
+ // WP adds timezone. See #2036
+ $this->timezone = '';
}
function parseIso($iso) {
$this->year = substr($iso, 0, 4);
$this->hour = substr($iso, 9, 2);
$this->minute = substr($iso, 12, 2);
$this->second = substr($iso, 15, 2);
+ // WP adds timezone. See #2036
$this->timezone = substr($iso, 17);
}
function getIso() {
+ // WP adds timezone. See #2036
return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
}
function getXml() {