i try to modivied some script @ JsonRpcServer.class.php:
private function isValidRequestObjectId($requestId) {
if(is_string($resquestId))
$resquestId=(float)$resquestId;
if(is_null($requestId) OR is_int($requestId))
return true;
else
return false;
/return (is_null($requestId)
|| is_string($requestId)
// 2 and "2" is valid but 2.1 and "2.1" is not
|| (ctype_digit($requestId) xor is_int($requestId)));/
}
at your code, it will make mistake if $resquest id between 48 to 57. Because return from ctype_digit($requestId) will be true and is_int($requestId) is true. So, the return will be false because xor must not true each other.
i try to modivied some script @ JsonRpcServer.class.php:
private function isValidRequestObjectId($requestId) {
if(is_string($resquestId))
$resquestId=(float)$resquestId;
if(is_null($requestId) OR is_int($requestId))
return true;
else
return false;
/return (is_null($requestId)
|| is_string($requestId)
// 2 and "2" is valid but 2.1 and "2.1" is not
|| (ctype_digit($requestId) xor is_int($requestId)));/
}
at your code, it will make mistake if $resquest id between 48 to 57. Because return from ctype_digit($requestId) will be true and is_int($requestId) is true. So, the return will be false because xor must not true each other.