diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 4f21de5ca8..91001a6289 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -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)