From 4eb68bf63f1791b7e108f6a8516ad92f4777cdd9 Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Sat, 3 Jun 2017 14:04:47 +0700 Subject: [PATCH] Do not parse invalid input strings as floats (see #125) --- src/Type/Definition/FloatType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Type/Definition/FloatType.php b/src/Type/Definition/FloatType.php index 363ce27..fb6ce02 100644 --- a/src/Type/Definition/FloatType.php +++ b/src/Type/Definition/FloatType.php @@ -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; }