-
Notifications
You must be signed in to change notification settings - Fork 818
Description
I started a project yesterday that depends on your CURL class and I noticed that there's a problem with response. Before your class, I used another one that always returned "string" as response, no matter what Content-Type it actually is.
So after converting to your class, I noticed that my project is failing everywhere I used json_decode()
or new SimpleXMLElement
, as it returns the properly formatted object already, except that it fails for XML in some situations.
I tracked down your method parseResponse
and noticed that simplexml_load_string
is not good for every XML situation where it may contain nested XML objects (if I may call it that way).
So I just made slight modification from this:
$xml_obj = @simplexml_load_string($response);
To this:
$xml_obj = @simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
And now it works perfectly... Just a tip, hopefully it will get updated officially after you read this.
I am not familiar with contributions - where I make changes and you add to the master branch, so I'll try to avoid that for now and just open the issue as it's simpler this way.