Do not parse invalid input strings as floats (see #125)

This commit is contained in:
Vladimir Razuvaev 2017-06-03 14:04:47 +07:00
parent 6fb62b25b3
commit 4eb68bf63f

View File

@ -67,7 +67,7 @@ values as specified by
public function parseLiteral($ast)
{
if ($ast instanceof FloatValueNode || $ast instanceof IntValueNode) {
return (float) $ast->value;
return is_numeric($ast->value) ? (float) $ast->value : null;
}
return null;
}