summaryrefslogtreecommitdiffstats
path: root/etc/inc/xmlrpc_server.inc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-09-20 18:02:23 +0000
committerColin Smith <colin@pfsense.org>2005-09-20 18:02:23 +0000
commit012b69834bef909dd9964229a88d4d9b329f5ade (patch)
treec121e614be17e098be35c1990a51c285ca614133 /etc/inc/xmlrpc_server.inc
parent2a257ba6e5039d4f5ee073db19bc2b4c57e5b5aa (diff)
downloadpfsense-012b69834bef909dd9964229a88d4d9b329f5ade.zip
pfsense-012b69834bef909dd9964229a88d4d9b329f5ade.tar.gz
Update PEAR XML_RPC package to 1.4.2.
Diffstat (limited to 'etc/inc/xmlrpc_server.inc')
-rw-r--r--etc/inc/xmlrpc_server.inc36
1 files changed, 25 insertions, 11 deletions
diff --git a/etc/inc/xmlrpc_server.inc b/etc/inc/xmlrpc_server.inc
index 276470c..5767832 100644
--- a/etc/inc/xmlrpc_server.inc
+++ b/etc/inc/xmlrpc_server.inc
@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-/* $Id$ */
/**
* Server commands for our PHP implementation of the XML-RPC protocol
@@ -41,7 +40,7 @@
/**
* Pull in the XML_RPC class
*/
-require_once 'xmlrpc_client.inc';
+require_once 'XML/RPC.php';
/**
@@ -215,7 +214,7 @@ function XML_RPC_Server_methodHelp($server, $m)
$dmap = $server->dmap;
$sysCall = 0;
}
- // print "<!-- ${methName} -->\n";
+
if (isset($dmap[$methName])) {
if ($dmap[$methName]['docstring']) {
$r = new XML_RPC_Response(new XML_RPC_Value($dmap[$methName]['docstring']),
@@ -271,7 +270,7 @@ function XML_RPC_Server_debugmsg($m)
* @author Martin Jansen <mj@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1999-2001 Edd Dumbill, 2001-2005 The PHP Group
- * @version Release: 1.3.1
+ * @version Release: 1.4.2
* @link http://pear.php.net/package/XML_RPC
*/
class XML_RPC_Server
@@ -386,8 +385,12 @@ class XML_RPC_Server
*/
function service()
{
- $this->createServerPayload();
- $this->createServerHeaders();
+ if (!$this->server_payload) {
+ $this->createServerPayload();
+ }
+ if (!$this->server_headers) {
+ $this->createServerHeaders();
+ }
header($this->server_headers);
print $this->server_payload;
}
@@ -502,11 +505,12 @@ class XML_RPC_Server
$parser = (int) $parser_resource;
$XML_RPC_xh[$parser] = array();
- $XML_RPC_xh[$parser]['st'] = '';
$XML_RPC_xh[$parser]['cm'] = 0;
$XML_RPC_xh[$parser]['isf'] = 0;
$XML_RPC_xh[$parser]['params'] = array();
$XML_RPC_xh[$parser]['method'] = '';
+ $XML_RPC_xh[$parser]['stack'] = array();
+ $XML_RPC_xh[$parser]['valuestack'] = array();
$plist = '';
@@ -523,16 +527,26 @@ class XML_RPC_Server
xml_error_string(xml_get_error_code($parser_resource)),
xml_get_current_line_number($parser_resource)));
xml_parser_free($parser_resource);
+ } elseif ($XML_RPC_xh[$parser]['isf']>1) {
+ $r = new XML_RPC_Response(0,
+ $XML_RPC_err['invalid_request'],
+ $XML_RPC_str['invalid_request']
+ . ': '
+ . $XML_RPC_xh[$parser]['isf_reason']);
+ xml_parser_free($parser_resource);
} else {
xml_parser_free($parser_resource);
$m = new XML_RPC_Message($XML_RPC_xh[$parser]['method']);
// now add parameters in
for ($i = 0; $i < sizeof($XML_RPC_xh[$parser]['params']); $i++) {
// print '<!-- ' . $XML_RPC_xh[$parser]['params'][$i]. "-->\n";
- $plist .= "$i - " . $XML_RPC_xh[$parser]['params'][$i] . " \n";
- eval('$m->addParam(' . $XML_RPC_xh[$parser]['params'][$i] . ');');
+ $plist .= "$i - " . var_export($XML_RPC_xh[$parser]['params'][$i], true) . " \n";
+ $m->addParam($XML_RPC_xh[$parser]['params'][$i]);
+ }
+
+ if ($this->debug) {
+ XML_RPC_Server_debugmsg($plist);
}
- XML_RPC_Server_debugmsg($plist);
// now to deal with the method
$methName = $XML_RPC_xh[$parser]['method'];
@@ -610,4 +624,4 @@ class XML_RPC_Server
* End:
*/
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud