check for a valid birthday date if we run the contacts cleanup tool

This commit is contained in:
Christian Binder 2009-12-02 11:06:01 +00:00
parent 81aa0dcc26
commit 144f5fe24c

View File

@ -504,6 +504,12 @@ class addressbook_bo extends addressbook_so
{
$fields_to_update[$field_name] = $field_value = null;
}
// check for valid birthday date
if ($field_name == 'bday' && $field_value != null &&
!preg_match('/^(18|19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/',$field_value))
{
$fields_to_update[$field_name] = $field_value = null;
}
}
if(count($fields_to_update) > 0)