Skip to content

Commit

Permalink
Merge pull request #226 from marijnotte/master
Browse files Browse the repository at this point in the history
Support CDATA with leading spaces
  • Loading branch information
alexdebril authored Oct 3, 2019
2 parents e713055 + 1c75a2c commit 12ec103
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/FeedIo/Rule/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class Description extends RuleAbstract
public function setProperty(NodeInterface $node, \DOMElement $element) : void
{
$string = '';
if ($element->firstChild && $element->firstChild->nodeType == XML_CDATA_SECTION_NODE) {
$string = $element->firstChild->textContent;
} else {
foreach ($element->childNodes as $childNode) {
foreach ($element->childNodes as $childNode) {
if ($childNode->nodeType == XML_CDATA_SECTION_NODE) {
$string .= $childNode->textContent;
} else {
$string .= $element->ownerDocument->saveXML($childNode);
}
}
Expand Down

0 comments on commit 12ec103

Please sign in to comment.