Fixed code to work when body is empty

Now passes empty JSON data through the collection system to remove
errors about unknown keys when posting via other methods
v1
Cuonic 13 years ago
parent a8f50e2f4b
commit d097c21dcb

@ -187,9 +187,12 @@ class Request {
if (strpos($this->type, 'application/json') === 0 && $this->body != '') { if (strpos($this->type, 'application/json') === 0 && $this->body != '') {
$this->json = json_decode($this->body, true); $this->json = json_decode($this->body, true);
$this->json = new Collection($this->json); } else {
$this->json = array();
} }
$this->json = new Collection($this->json);
} }
/** /**

Loading…
Cancel
Save