summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/xmlrpc.inc10
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc
index d316d95..445fa26 100644
--- a/includes/xmlrpc.inc
+++ b/includes/xmlrpc.inc
@@ -157,11 +157,6 @@ function xmlrpc_message($message) {
* TRUE if parsing succeeded; FALSE otherwise
*/
function xmlrpc_message_parse(&$xmlrpc_message) {
- // First remove the XML declaration
- $xmlrpc_message->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $xmlrpc_message->message);
- if (trim($xmlrpc_message->message) == '') {
- return FALSE;
- }
$xmlrpc_message->_parser = xml_parser_create();
// Set XML parser to take the case of tags into account.
xml_parser_set_option($xmlrpc_message->_parser, XML_OPTION_CASE_FOLDING, FALSE);
@@ -175,7 +170,10 @@ function xmlrpc_message_parse(&$xmlrpc_message) {
xml_parser_free($xmlrpc_message->_parser);
// Grab the error messages, if any
$xmlrpc_message = xmlrpc_message_get();
- if ($xmlrpc_message->messagetype == 'fault') {
+ if (!isset($xmlrpc_message->messagetype)) {
+ return FALSE;
+ }
+ elseif ($xmlrpc_message->messagetype == 'fault') {
$xmlrpc_message->fault_code = $xmlrpc_message->params[0]['faultCode'];
$xmlrpc_message->fault_string = $xmlrpc_message->params[0]['faultString'];
}