From 8a52cdf35af9a714e9b330fa0aace6606b071c89 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 1 Jul 2010 19:43:47 +0200 Subject: XML-RPC fix for untyped string values FS#1993 includes unit tests. Extensions welcome. --- inc/IXR_Library.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'inc/IXR_Library.php') diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php index 2fb7dfe68..c7f83a6d6 100644 --- a/inc/IXR_Library.php +++ b/inc/IXR_Library.php @@ -136,6 +136,7 @@ class IXR_Message { var $_value; var $_currentTag; var $_currentTagContents; + var $_lastseen; // The XML parser var $_parser; function IXR_Message ($message) { @@ -194,6 +195,7 @@ class IXR_Message { $this->_arraystructs[] = array(); break; } + $this->_lastseen = $tag; } function cdata($parser, $cdata) { $this->_currentTagContents .= $cdata; @@ -225,9 +227,11 @@ class IXR_Message { break; case 'value': // "If no type is indicated, the type is string." - $value = (string)$this->_currentTagContents; - $this->_currentTagContents = ''; - $valueFlag = true; + if($this->_lastseen == 'value'){ + $value = (string)$this->_currentTagContents; + $this->_currentTagContents = ''; + $valueFlag = true; + } break; case 'boolean': $value = (boolean)trim($this->_currentTagContents); @@ -278,6 +282,7 @@ class IXR_Message { $this->params[] = $value; } } + $this->_lastseen = $tag; } } -- cgit v1.2.3