Skip to content

Commit 1bbf0a5

Browse files
author
viacheslav diomidov
committed
BUGFIX PPP-54497 simpleXml fix for & in values
1 parent 5aca8ae commit 1bbf0a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Api/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ protected function _expandRequestShortSyntax($request, SimpleXMLElement $xml)
324324

325325
foreach ($parts as $part) {
326326
@list($name, $value) = explode('=', $part);
327-
$node->{$name} = $value;
327+
$node = $node->addChild($name, htmlspecialchars($value));
328328
}
329329

330330
return $xml->asXML();
@@ -346,7 +346,7 @@ protected function _arrayToXml(array $array, SimpleXMLElement $xml, $parentEl =
346346
if (is_array($value)) {
347347
$this->_arrayToXml($value, $this->_isAssocArray($value) ? $xml->addChild($el) : $xml, $el);
348348
} else {
349-
$xml->addChild($el, htmlspecialchars($value));
349+
$xml->{$el} = $value;
350350
}
351351
}
352352

0 commit comments

Comments
 (0)