mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-10 14:05:32 +00:00
Fix #295: Allow setting a custom XML decoder
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user