silverstripe-archive / silverstripe-newsletter

NewsletterAdmin is the CMS class for managing the newsletter system.
BSD 3-Clause "New" or "Revised" License
69 stars 59 forks source link

required field are not correctly validated #119

Closed alwex closed 7 years ago

alwex commented 7 years ago

While declaring additional fields as required for subscription, the validation does not handle it correctly because of this line:

$required = new RequiredFields($requiredFields);

where fields name are the keys and not the values, a fix would be

$required = new RequiredFields(array_keys(array_filter($requiredFields)));