Skip to content

Commit

Permalink
Fixed blueprint field validation: Allow numeric inputs in text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed May 22, 2018
1 parent b82c17e commit 3ccadde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion system/src/Grav/Common/Data/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ public static function filter($value, array $field)
*/
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;
}
Expand Down

0 comments on commit 3ccadde

Please sign in to comment.