mirror of
https://github.com/getgrav/grav.git
synced 2025-12-07 00:09:57 +01:00
Addresses # 12 (form-plugin) Trim fields before validation
This commit is contained in:
@@ -588,6 +588,10 @@ class Validation
|
|||||||
|
|
||||||
public static function validateRequired($value, $params)
|
public static function validateRequired($value, $params)
|
||||||
{
|
{
|
||||||
|
if (is_string($value)) {
|
||||||
|
$value = trim($value);
|
||||||
|
}
|
||||||
|
|
||||||
return (bool) $params !== true || !empty($value);
|
return (bool) $params !== true || !empty($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user