expectedbehavior / php-docraptor

PHP consumer for the DocRaptor.com API
ISC License
7 stars 1 forks source link

urlencoded document contents can't be handled by the service #11

Closed markushausammann closed 9 years ago

markushausammann commented 9 years ago

The wrapper currently does urlencode() on the content that is sent to DR.

https://github.com/expectedbehavior/php-docraptor/blob/master/src/DocRaptor.php#L176

But DR doesn't decode and instead just prints the whole content as a string. Is that expectedbehavior :smirk: or would it make sense to decode encoded strings?

janxious commented 9 years ago

Can you give me an example of what you're seeing?

markushausammann commented 9 years ago

markushausammann commented 9 years ago

If I remove the urlencode, everything looks nice.

janxious commented 9 years ago

I think what is happening is http://php.net/manual/en/function.http-build-query.php is encoding it a second time.

janxious commented 9 years ago

So yeah, we can probably remove that.

markushausammann commented 9 years ago

Ah yeah, that's it, sure. We either have to switch off the implicit call in the http_build_query (if possible) or write a comment, otherwise it looks as if it's not encoded. I'll take care of it.

janxious commented 9 years ago

I would much rather we rely on http_build_query.

markushausammann commented 9 years ago

Ok, let's just add a comment to the other line explaining why there is no urlencode call there.