Fix #295: Allow setting a custom XML decoder

This commit is contained in:
Zach Borboa
2016-01-31 04:20:26 -08:00
parent 266bc12345
commit 8cf2631c54
4 changed files with 78 additions and 3 deletions
+22
View File
@@ -182,6 +182,28 @@ if ($test == 'http_basic_auth') {
$rss->appendChild($channel);
echo $doc->saveXML();
exit;
} elseif ($test === 'xml_with_cdata_response') {
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>
<rss>
<items>
<item>
<id>1</id>
<ref>33ee7e1eb504b6619c1b445ca1442c21</ref>
<title><![CDATA[The Title]]></title>
<description><![CDATA[The description.]]></description>
<link><![CDATA[https://www.example.com/page.html?foo=bar&baz=wibble#hash]]></link>
</item>
<item>
<id>2</id>
<ref>b5c0b187fe309af0f4d35982fd961d7e</ref>
<title><![CDATA[Another Title]]></title>
<description><![CDATA[Some description.]]></description>
<link><![CDATA[https://www.example.org/image.png?w=1265.73&h=782.26]]></link>
</item>
</items>
</rss>';
exit;
} elseif ($test === 'upload_response') {
$tmp_filename = tempnam('/tmp', 'php-curl-class.');
move_uploaded_file($_FILES['image']['tmp_name'], $tmp_filename);