diff options
author | friendica <info@friendica.com> | 2013-07-03 16:55:57 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-07-03 16:55:57 -0700 |
commit | 42d5d515b25e1bf0068da6bbf4ffef2374f02617 (patch) | |
tree | 5163671b3d6aa1bc0248541fef5da1972b1e0f77 | |
parent | 429ebabfd98240fe7d69ba81879ee35769af305f (diff) | |
download | volse-hubzilla-42d5d515b25e1bf0068da6bbf4ffef2374f02617.tar.gz volse-hubzilla-42d5d515b25e1bf0068da6bbf4ffef2374f02617.tar.bz2 volse-hubzilla-42d5d515b25e1bf0068da6bbf4ffef2374f02617.zip |
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.
-rw-r--r-- | mod/profiles.php | 5 |
1 files changed, 5 insertions, 0 deletions
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); |