Closed plumbum closed 8 years ago
I believe you are correct that this is a bug at Controller.php line 90.
According to the JSON-RPC 2.0 specs, the id must be a String, Number, or NULL if included, and the server must reply with the same value in the Response object if it was included.
By the looks of it, I think the conditional on Controller.php line 90 is only meant to test whether or not we can safely reference $this->requestObject->id
without throwing an error. The !empty
might be replaced with isset
to fix this:
return Helper::formatResponse($result, $error, isset($this->requestObject->id) ? $this->requestObject->id : null);
Thanks you. Yes, i thing, that 'isset' is good idea. I replace it on my code, and it worked correctly.
Thanks guys, i've changed condition to isset in the latest commit.
Hello.
If i send request with data
I get bad response
This problem located at Controller.php line 90
PHP is crazy and he thinking, that number 0 or string "0" is empty.