BUGFIX EXTREST-137 simpleXml fix for & in values#109
Conversation
Codecov Report
@@ Coverage Diff @@
## master #109 +/- ##
============================================
+ Coverage 91.59% 91.81% +0.21%
- Complexity 353 354 +1
============================================
Files 81 81
Lines 1035 1038 +3
============================================
+ Hits 948 953 +5
+ Misses 87 85 -2
Continue to review full report at Codecov.
|
70b5a9f to
9df581f
Compare
src/Api/Client.php
Outdated
| $this->_arrayToXml($value, $this->_isAssocArray($value) ? $xml->addChild($el) : $xml, $el); | ||
| } else { | ||
| $xml->addChild($el, $value); | ||
| $xml->addChild($el, htmlspecialchars($value)); |
There was a problem hiding this comment.
then we get the problem
It is not yet possible to assign complex types to properties
There was a problem hiding this comment.
hmm, does it work with htmlspecialchars? It seems to cast string type for any complex type.
There was a problem hiding this comment.
maybe $xml->{$el} = (string)$value?
There was a problem hiding this comment.
what is the type of $value in case of the problem?
| @@ -114,6 +114,7 @@ private function _get($command, $field, $value) | |||
| $filterTag = $getTag->addChild('filter'); | |||
| if (!is_null($field)) { | |||
| $filterTag->addChild($field, $value); | |||
src/Api/Operator/Database.php
Outdated
| @@ -136,6 +136,7 @@ private function _get($command, $field, $value) | |||
| $filterTag = $getTag->addChild('filter'); | |||
| if (!is_null($field)) { | |||
| $filterTag->addChild($field, $value); | |||
src/Api/Operator/Site.php
Outdated
| $propertyNode = $hostingNode->addChild('property'); | ||
| $propertyNode->addChild('name', $name); | ||
| $propertyNode->addChild('value', $value); | ||
| $propertyNode->addChild('value', htmlspecialchars($value)); |
There was a problem hiding this comment.
$propertyNode->name = $name;
$propertyNode->value = $value;
src/Api/Operator/Webspace.php
Outdated
| $property = $infoHosting->addChild('property'); | ||
| $property->addChild('name', $name); | ||
| $property->addChild('value', $value); | ||
| $property->addChild('value', htmlspecialchars($value)); |
There was a problem hiding this comment.
$property->name = $name;
$property->value = $value;
3631e26 to
443f9fa
Compare
src/Api/Client.php
Outdated
| foreach ($parts as $part) { | ||
| @list($name, $value) = explode('=', $part); | ||
| $node = $node->addChild($name, $value); | ||
| $node = $node->addChild($name, htmlspecialchars($value)); |
There was a problem hiding this comment.
the value here is always string (as the result of explode). you can use $node->{$name} = $value
657e96a to
a4e30a1
Compare
a4e30a1 to
c3328f4
Compare
813dbaa to
21ecea0
Compare
No description provided.