From 42d5d515b25e1bf0068da6bbf4ffef2374f02617 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 3 Jul 2013 16:55:57 -0700 Subject: 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. --- mod/profiles.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 28d8dd973..173d97138 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -200,6 +200,11 @@ function profiles_post(&$a) { $day = intval($_POST['day']); if(($day > $mtab[$month]) || ($day < 0)) $day = 0; + + if($year && (! ($month && $day))) { + $month = 1; $day = 1; + } + $dob = '0000-00-00'; $dob = sprintf('%04d-%02d-%02d',$year,$month,$day); -- cgit v1.2.3