diff --git a/phpgwapi/inc/class.interserver.inc.php b/phpgwapi/inc/class.interserver.inc.php index ed0c9cf99a..74723e2508 100644 --- a/phpgwapi/inc/class.interserver.inc.php +++ b/phpgwapi/inc/class.interserver.inc.php @@ -198,13 +198,13 @@ if (!$r->faultCode()) { $this->debug('
I got this value back
' . htmlentities($r->serialize()) . '

',$debug); + $this->result = xmlrpc_decode($v); } else { $this->debug('Fault Code: ' . $r->faultCode() . ' Reason "' . $r->faultString() . '"
',$debug); + $this->result = htmlentities($r->serialize()); } - - $this->result = xmlrpc_decode($v); return $this->result; } @@ -251,13 +251,13 @@ if (!$r->faultCode()) { $this->debug('
I got this value back
' . htmlentities($r->serialize()) . '

',$debug); + $this->result = xmlrpc_decode($v); } else { $this->debug('Fault Code: ' . $r->faultCode() . ' Reason "' . $r->faultString() . '"
',$debug); + $this->result = htmlentities($r->serialize()); } - - $this->result = xmlrpc_decode($v); return $this->result; } diff --git a/phpgwapi/inc/class.xmlrpc_client.inc.php b/phpgwapi/inc/class.xmlrpc_client.inc.php index 6c945fc72d..044e33a047 100644 --- a/phpgwapi/inc/class.xmlrpc_client.inc.php +++ b/phpgwapi/inc/class.xmlrpc_client.inc.php @@ -114,20 +114,21 @@ } if($timeout>0) { - $fp = fsockopen($server, $port,&$this->errno, &$this->errstr, $timeout); + $fp = fsockopen($server, $port, &$this->errno, &$this->errstr, $timeout); } else { - $fp = fsockopen($server, $port,&$this->errno, &$this->errstr); + $fp = fsockopen($server, $port, &$this->errno, &$this->errstr); } if (!$fp) { - return CreateObject( + $r = CreateObject( 'phpgwapi.xmlrpcresp', - 0, + '', $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error'] ); + return $r; } // Only create the payload if it was not created previously if(empty($msg->payload)) @@ -157,7 +158,7 @@ $this->errstr = 'Write error'; return CreateObject( 'phpgwapi.xmlrpcresp', - 0, + '', $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error'] ); @@ -174,7 +175,7 @@ { return CreateObject( 'phpgwapi.xmlrpcresp', - 0, + '', $GLOBALS['xmlrpcerr']['no_ssl'], $GLOBALS['xmlrpcstr']['no_ssl'] ); @@ -236,7 +237,7 @@ $this->errstr = 'Write error'; $resp = CreateObject( 'phpgwapi.xmlrpcresp', - 0, + '', $GLOBALS['xmlrpcerr']['curl_fail'], $GLOBALS['xmlrpcstr']['curl_fail'] . ': ' . curl_error($curl) ); diff --git a/phpgwapi/inc/class.xmlrpc_server.inc.php b/phpgwapi/inc/class.xmlrpc_server.inc.php index 49f45a121e..088f8cb6ba 100644 --- a/phpgwapi/inc/class.xmlrpc_server.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server.inc.php @@ -249,7 +249,7 @@ if (!xml_parse($parser, $data, 1)) { // return XML error as a faultCode - $r = CreateObject('phpgwapi.xmlrpcresp',0, + $r = CreateObject('phpgwapi.xmlrpcresp','', $GLOBALS['xmlrpcerrxml'] + xml_get_error_code($parser), sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($parser)), @@ -293,10 +293,9 @@ if($sysCall && $this->authed) { $r = CreateObject('phpgwapi.xmlrpcresp', - CreateObject('phpgwapi.xmlrpcval', - $GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName, - 'string' - ) + '', + $GLOBALS['xmlrpcerr']['unknown_method'], + $GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName ); return $r; } @@ -384,10 +383,9 @@ else { $r = CreateObject('phpgwapi.xmlrpcresp', - CreateObject('phpgwapi.xmlrpcval', - $GLOBALS['xmlrpcstr']['incorrect_params'] . ': ' . $sr[1], - 'string' - ) + '', + $GLOBALS['xmlrpcerr']['incorrect_params'], + $GLOBALS['xmlrpcstr']['incorrect_params'] . ': ' . $sr[1] ); } } @@ -396,15 +394,19 @@ // else prepare error response if(!$this->authed) { - $r = CreateObject('phpgwapi.xmlrpcresp',CreateObject('phpgwapi.xmlrpcval','UNAUTHORIZED','string')); + $r = CreateObject('phpgwapi.xmlrpcresp', + CreateObject('phpgwapi.xmlrpcval', + 'UNAUTHORIZED', + 'string' + ) + ); } else { $r = CreateObject('phpgwapi.xmlrpcresp', - CreateObject('phpgwapi.xmlrpcval', - $GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName, - 'string' - ) + '', + $GLOBALS['xmlrpcerr']['unknown_method'], + $GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName ); } } diff --git a/phpgwapi/inc/class.xmlrpcmsg.inc.php b/phpgwapi/inc/class.xmlrpcmsg.inc.php index d230b76548..445fa245d3 100644 --- a/phpgwapi/inc/class.xmlrpcmsg.inc.php +++ b/phpgwapi/inc/class.xmlrpcmsg.inc.php @@ -151,7 +151,7 @@ { $errstr = substr($data, 0, strpos($data, "\n")-1); error_log('HTTP error, got response: ' .$errstr); - $r = CreateObject('phpgwapi.xmlrpcresp',0, $GLOBALS['xmlrpcerr']['http_error'], + $r = CreateObject('phpgwapi.xmlrpcresp','', $GLOBALS['xmlrpcerr']['http_error'], $GLOBALS['xmlrpcstr']['http_error'] . ' (' . $errstr . ')'); xml_parser_free($parser); return $r; @@ -199,7 +199,7 @@ xml_get_current_line_number($parser)); } error_log($errstr); - $r = CreateObject('phpgwapi.xmlrpcresp', 0, $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']); + $r = CreateObject('phpgwapi.xmlrpcresp', '', $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']); xml_parser_free($parser); return $r; } @@ -215,7 +215,7 @@ // then something odd has happened // and it's time to generate a client side error // indicating something odd went on - $r = CreateObject('phpgwapi.xmlrpcresp', 0, $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']); + $r = CreateObject('phpgwapi.xmlrpcresp', '', $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']); } else { diff --git a/phpgwapi/inc/class.xmlrpcresp.inc.php b/phpgwapi/inc/class.xmlrpcresp.inc.php index c12b7d15e5..f391643dba 100644 --- a/phpgwapi/inc/class.xmlrpcresp.inc.php +++ b/phpgwapi/inc/class.xmlrpcresp.inc.php @@ -68,7 +68,7 @@ function serialize() { $rs=''."\n"; - if ($this->fn) + if (isset($this->fn) && !empty($this->fn)) { $rs .= '