datto/php-json-rpc

Implementation::isValidCode($code) bug

Closed this issue · 1 comments

return is_int($code) && (-32000 <= $code) && ($code <= -32099);

return is_int($code) && (-32000 <= $code) && ($code <= -32099);
should be changed to
return is_int($code) && (-32099 <= $code) && ($code <= -32000);
because the original condition is never true

Wow, I wasn't expected that there were any bugs in the codebase. Thank you for finding that range issue!

I've released a new version (4.0.4) with your fix:
0f4b4e5

~Spencer