Skip to content

Commit 6566587

Browse files
committed
fixed CDATA in xml
1 parent 95e2f79 commit 6566587

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Providers/OEmbed.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ public function run()
4949
if (($endPointRequest->getExtension() === 'xml') || ($endPointRequest->getQueryParameter('format') === 'xml')) {
5050
if ($parameters = $endPointRequest->getXmlContent()) {
5151
foreach ($parameters as $element) {
52-
$this->bag->set($element->getName(), (string) $element);
52+
$content = trim((string) $element);
53+
54+
if (stripos($content, '<![CDATA[') === 0) {
55+
$content = substr($content, 9, -3);
56+
}
57+
58+
$this->bag->set($element->getName(), $content);
5359
}
5460
}
5561
// extract from json

0 commit comments

Comments
 (0)