aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-03 16:55:57 -0700
committerfriendica <info@friendica.com>2013-07-03 16:55:57 -0700
commit42d5d515b25e1bf0068da6bbf4ffef2374f02617 (patch)
tree5163671b3d6aa1bc0248541fef5da1972b1e0f77
parent429ebabfd98240fe7d69ba81879ee35769af305f (diff)
downloadvolse-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.php5
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);