Remove 'fix' for issue caused by php.ini setting

This commit is contained in:
Timothy Warren 2017-02-09 13:45:40 -05:00
parent 18af49f1f4
commit 50c543218b

View File

@ -118,7 +118,7 @@ class APIRequestBuilder {
public function setFormFields(array $fields): self public function setFormFields(array $fields): self
{ {
$this->setHeader("Content-Type", "application/x-www-form-urlencoded"); $this->setHeader("Content-Type", "application/x-www-form-urlencoded");
$body = $this->fixBody((new FormBody)->addFields($fields)); $body = (new FormBody)->addFields($fields);
$this->setBody($body); $this->setBody($body);
return $this; return $this;
} }
@ -248,21 +248,6 @@ class APIRequestBuilder {
$this->request->setUri($url); $this->request->setUri($url);
} }
/**
* Unencode the dual-encoded ampersands in the body
*
* This is a dirty hack until I can fully track down where
* the dual-encoding happens
*
* @param FormBody $formBody The form builder object to fix
* @return string
*/
private function fixBody(FormBody $formBody): string
{
$rawBody = Amp\wait($formBody->getBody());
return html_entity_decode($rawBody, \ENT_HTML5, 'UTF-8');
}
/** /**
* Reset the class state for a new request * Reset the class state for a new request
* *