Skip to content

Commit 4eb68bf

Browse files
committed
Do not parse invalid input strings as floats (see #125)
1 parent 6fb62b2 commit 4eb68bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/Definition/FloatType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private function coerceFloat($value)
6767
public function parseLiteral($ast)
6868
{
6969
if ($ast instanceof FloatValueNode || $ast instanceof IntValueNode) {
70-
return (float) $ast->value;
70+
return is_numeric($ast->value) ? (float) $ast->value : null;
7171
}
7272
return null;
7373
}

0 commit comments

Comments
 (0)