summaryrefslogtreecommitdiff
path: root/inc/IXR_Library.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2010-07-01 19:43:47 +0200
committerAndreas Gohr <andi@splitbrain.org>2010-07-01 19:44:41 +0200
commit8a52cdf35af9a714e9b330fa0aace6606b071c89 (patch)
tree872636282283720b856cfc2a19296d25646fd0ef /inc/IXR_Library.php
parent138cf4d45bdc87d14db5c07e22685c0482085c1f (diff)
downloadrpg-8a52cdf35af9a714e9b330fa0aace6606b071c89.tar.gz
rpg-8a52cdf35af9a714e9b330fa0aace6606b071c89.tar.bz2
XML-RPC fix for untyped string values FS#1993
includes unit tests. Extensions welcome.
Diffstat (limited to 'inc/IXR_Library.php')
-rw-r--r--inc/IXR_Library.php11
1 files changed, 8 insertions, 3 deletions
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;
}
}