birthday error checking - if year is present but no month or day, set to 1 January. Otherwise the date will be set to 30 November the prior year due to how the PHP strtotime() function works.
This commit is contained in:
parent
429ebabfd9
commit
42d5d515b2
@ -200,6 +200,11 @@ function profiles_post(&$a) {
|
|||||||
$day = intval($_POST['day']);
|
$day = intval($_POST['day']);
|
||||||
if(($day > $mtab[$month]) || ($day < 0))
|
if(($day > $mtab[$month]) || ($day < 0))
|
||||||
$day = 0;
|
$day = 0;
|
||||||
|
|
||||||
|
if($year && (! ($month && $day))) {
|
||||||
|
$month = 1; $day = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$dob = '0000-00-00';
|
$dob = '0000-00-00';
|
||||||
$dob = sprintf('%04d-%02d-%02d',$year,$month,$day);
|
$dob = sprintf('%04d-%02d-%02d',$year,$month,$day);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user