From 3ccadded973070170fb78dceb9da20067ec435ff Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Tue, 22 May 2018 10:42:30 +0300 Subject: [PATCH] Fixed blueprint field validation: Allow numeric inputs in text fields --- CHANGELOG.md | 1 + system/src/Grav/Common/Data/Validation.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0b1f08f2..814c75750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Fixed bug in `ContentBlock` serialization * Fixed `Route::withQueryParam()` to accept array values * Fixed typo in truncate function [#1943](https://github.com/getgrav/grav/issues/1943) + * Fixed blueprint field validation: Allow numeric inputs in text fields # v1.4.4 ## 05/11/2018 diff --git a/system/src/Grav/Common/Data/Validation.php b/system/src/Grav/Common/Data/Validation.php index 1069fec99..3d982b749 100644 --- a/system/src/Grav/Common/Data/Validation.php +++ b/system/src/Grav/Common/Data/Validation.php @@ -128,10 +128,12 @@ class Validation */ public static function typeText($value, array $params, array $field) { - if (!is_string($value)) { + if (!is_string($value) && !is_numeric($value)) { return false; } + $value = (string)$value; + if (isset($params['min']) && strlen($value) < $params['min']) { return false; }