diff --git a/src/Curl.class.php b/src/Curl.class.php index b0346ba..9624dfb 100644 --- a/src/Curl.class.php +++ b/src/Curl.class.php @@ -350,7 +350,8 @@ class Curl if (!is_null($json_obj)) { $ch->response = $json_obj; } - } elseif (preg_match('/^application\/xml/i', $ch->response_headers['Content-Type']) || + } elseif (preg_match('/^application\/rss\+xml/i', $ch->response_headers['Content-Type']) || + preg_match('/^application\/xml/i', $ch->response_headers['Content-Type']) || preg_match('/^text\/xml/i', $ch->response_headers['Content-Type'])) { $xml_obj = @simplexml_load_string($ch->response); if (!($xml_obj === false)) { diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index 76317f7..b8adda3 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -432,6 +432,12 @@ class CurlTest extends PHPUnit_Framework_TestCase { PHPUnit_Framework_Assert::assertInstanceOf('SimpleXMLElement', $test->curl->response); } + xml_assertion('Content-Type', 'application/rss+xml; charset=utf-8'); + xml_assertion('content-type', 'application/rss+xml; charset=utf-8'); + xml_assertion('Content-Type', 'application/rss+xml'); + xml_assertion('content-type', 'application/rss+xml'); + xml_assertion('CONTENT-TYPE', 'application/rss+xml'); + xml_assertion('CONTENT-TYPE', 'application/rss+xml'); xml_assertion('Content-Type', 'application/xml; charset=utf-8'); xml_assertion('content-type', 'application/xml; charset=utf-8'); xml_assertion('Content-Type', 'application/xml');