Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5375' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Nov 1, 2013
167 parents a8a7058 + 3cb7437 + 65375a9 + a9322df + 4a236d9 + d33ea7d + dd7c7b1 + e4fdd4c + 4ea852c + 6e89cc1 + 46b4569 + b0e12bf + 40d2cad + dcdecad + 978a0d2 + f68efae + 24315d0 + 90bab68 + d5240ce + a4cf61f + 737988b + 24b691f + b2ba0b2 + 3df4d2a + d37df59 + 7f0c1ad + 25ddb64 + 61dafd7 + 6eb1418 + 72e4c73 + 484fecb + 17ed9ab + 9881dbb + 6d7f5ab + 561ef2b + 567588e + ec0d061 + 3a9c051 + ffadf7b + 8c8ab46 + 56dffee + 9b3291e + 72011a1 + 79d20ae + 0023b68 + 203219a + 51f1e65 + adba36a + 48704a6 + 3ed141c + a79cdbd + 73871a0 + 47d468d + 538d0f4 + b5ad75a + 2363c4f + 91c2337 + 04dcb58 + 906c7b6 + 0da7bb6 + 0270a77 + 6784c86 + 90d950a + 3b5ea7f + 339830e + b04f4d5 + 8da9d32 + 0e2a882 + f0829e4 + c66d3bb + c44c042 + e2121f5 + 19560b1 + f08a210 + 294332a + 3ab34f5 + bb64c7d + b204532 + 1e8aff5 + da2423f + 7fce745 + 6c8026c + a449c92 + c9f86d3 + b2b0ea1 + 3b554ac + 4deeef8 + c6f5d24 + fdaf0f2 + 6047973 + 66f79d5 + ef273f8 + 6c44bc5 + ddae1cc + fc0f217 + 05d994b + 386083b + 7890c16 + 07c51ae + a62d81b + 53960c5 + 3521702 + e2fdffd + 160ad66 + 10bff24 + 944d975 + 71f09ad + 03fbbc3 + 5d527bf + 4281c0c + cc36360 + b1dde09 + e21037b + 08b1d98 + e693e44 + 0bd83de + 5dce05d + 3641177 + 226d56e + 6b82dec + 30e3679 + d702695 + e95ddeb + 6f8f3b1 + 9a73c30 + ef8261e + d9444bc + 1c0773a + e1a1f7a + 7781996 + 1524272 + 7cec1e0 + cf88eec + c11f566 + 0351056 + b5d005e + afdf14f + 94358ed + 6102afa + 1e99572 + 31681fd + 313e55d + 201b9ed + 27ee3a0 + cdbfa8a + ffed7ac + 0649e63 + dea5f03 + 73dcc77 + 5cce900 + 06d6397 + aaeffe0 + fab0f36 + 549fb43 + 299aee9 + 6cf210f + c755f8e + d35ab66 + 51693b6 + 0c1ab8a + 0da4e85 + afac5af + 4336267 + 7292945 + fc6508a + 7744bb9 + fd2fb34 commit 6cc5491
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AbstractValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,9 @@ protected static function _extractTypeAndValue(\SimpleXMLElement $xml, &$type, &
// If no type was specified, the default is string
if (!$type) {
$type = self::XMLRPC_TYPE_STRING;
if (empty($value) and preg_match('#^<value>.*</value>$#', $xml->asXML())) {
$value = str_replace(array('<value>', '</value>'), '', $xml->asXML());
}
}
}

Expand Down
15 changes: 15 additions & 0 deletions test/ValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ public function testMarshalStringFromNative()
$this->assertSame($native, $val->getValue());
}

public function testFactoryAutodetectsStringAndSetsValueInArray()
{
$val = AbstractValue::getXmlRpcValue('<value><array><data>'.
'<value><i4>8</i4></value>'.
'<value>a</value>'.
'<value>false</value>'.
'</data></array></value>', AbstractValue::XML_STRING
);
$this->assertXmlRpcType('array', $val);
$a = $val->getValue();
$this->assertSame(8, $a[0]);
$this->assertSame('a', $a[1]);
$this->assertSame('false', $a[2]);
}

/**
* @dataProvider ZendTest\XmlRpc\TestProvider::provideGenerators
*/
Expand Down

0 comments on commit 6cc5491

Please sign in to comment.