diff --git a/src/Curl.class.php b/src/Curl.class.php index 5d5e344..f77a780 100644 --- a/src/Curl.class.php +++ b/src/Curl.class.php @@ -309,7 +309,8 @@ class Curl if (!is_null($json_obj)) { $response = $json_obj; } - } elseif (preg_match('/^application\/rss\+xml/i', $response_headers['Content-Type']) || + } elseif (preg_match('/^application\/atom\+xml/i', $response_headers['Content-Type']) || + preg_match('/^application\/rss\+xml/i', $response_headers['Content-Type']) || preg_match('/^application\/xml/i', $response_headers['Content-Type']) || preg_match('/^text\/xml/i', $response_headers['Content-Type'])) { $xml_obj = @simplexml_load_string($response); diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index 8c55bf3..c4314ea 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -574,6 +574,8 @@ class CurlTest extends PHPUnit_Framework_TestCase PHPUnit_Framework_Assert::assertInstanceOf('SimpleXMLElement', $test->curl->response); } + xmlAssertion('Content-Type', 'application/atom+xml; charset=UTF-8'); + xmlAssertion('Content-Type', 'application/atom+xml;charset=UTF-8'); xmlAssertion('Content-Type', 'application/rss+xml'); xmlAssertion('Content-Type', 'application/rss+xml; charset=utf-8'); xmlAssertion('Content-Type', 'application/rss+xml;charset=utf-8'); @@ -584,6 +586,8 @@ class CurlTest extends PHPUnit_Framework_TestCase xmlAssertion('Content-Type', 'text/xml; charset=utf-8'); xmlAssertion('Content-Type', 'text/xml;charset=utf-8'); + xmlAssertion('content-type', 'application/atom+xml; charset=UTF-8'); + xmlAssertion('content-type', 'application/atom+xml;charset=UTF-8'); xmlAssertion('content-type', 'application/rss+xml'); xmlAssertion('content-type', 'application/rss+xml; charset=utf-8'); xmlAssertion('content-type', 'application/rss+xml;charset=utf-8'); @@ -594,6 +598,8 @@ class CurlTest extends PHPUnit_Framework_TestCase xmlAssertion('content-type', 'text/xml; charset=utf-8'); xmlAssertion('content-type', 'text/xml;charset=utf-8'); + xmlAssertion('CONTENT-TYPE', 'application/atom+xml; charset=UTF-8'); + xmlAssertion('CONTENT-TYPE', 'application/atom+xml;charset=UTF-8'); xmlAssertion('CONTENT-TYPE', 'application/rss+xml'); xmlAssertion('CONTENT-TYPE', 'application/rss+xml; charset=utf-8'); xmlAssertion('CONTENT-TYPE', 'application/rss+xml;charset=utf-8');