mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 21:27:28 +02:00
Added support for validation of multiple email in the type: email field (grav-plugin-email#31)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
# v1.1.0-rc.4
|
||||
## 06/xx/2016
|
||||
|
||||
1. [](#improved)
|
||||
* Added support for validation of multiple email in the `type: email` field [grav-plugin-email#31](https://github.com/getgrav/grav-plugin-email/issues/31)
|
||||
1. [](#bugfix)
|
||||
* Fix backend validation for file fields marked as required [grav-plugin-form#78](Fixes https://github.com/getgrav/grav-plugin-form/issues/78)
|
||||
* Fix backend validation for file fields marked as required [grav-plugin-form#78](https://github.com/getgrav/grav-plugin-form/issues/78)
|
||||
|
||||
# v1.1.0-rc.3
|
||||
## 06/21/2016
|
||||
|
||||
@@ -404,7 +404,15 @@ class Validation
|
||||
*/
|
||||
public static function typeEmail($value, array $params, array $field)
|
||||
{
|
||||
return self::typeText($value, $params, $field) && filter_var($value, FILTER_VALIDATE_EMAIL);
|
||||
$values = !is_array($value) ? explode(',', preg_replace('/\s+/', '', $value)) : $value;
|
||||
|
||||
foreach ($values as $value) {
|
||||
if (!(self::typeText($value, $params, $field) && filter_var($value, FILTER_VALIDATE_EMAIL))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user