Commit ee12ae64 authored by Dries's avatar Dries
Browse files

- Patch #63251 by sammys: added validation of dates.

parent 37a9229d
......@@ -830,6 +830,15 @@ function expand_date($element) {
return $element;
}
/**
* Validates the date type to stop dates like February 30, 2006.
*/
function date_validate($form) {
if (!checkdate($form['#value']['month'], $form['#value']['day'], $form['#value']['year'])) {
form_error($form, t('The specified date is invalid.'));
}
}
/**
* Helper function for usage with drupal_map_assoc to display month names.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment