diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-17 18:42:06 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-10-18 20:55:24 +0200 |
commit | f2d1f1efd6a268161461b1875ad134d60ea68a0e (patch) | |
tree | 868b6728139053680e0f52a7071a178160ea1c07 | |
parent | a7fd4e96f1960f486980393ec99e94ef629af855 (diff) | |
download | volse-hubzilla-f2d1f1efd6a268161461b1875ad134d60ea68a0e.tar.gz volse-hubzilla-f2d1f1efd6a268161461b1875ad134d60ea68a0e.tar.bz2 volse-hubzilla-f2d1f1efd6a268161461b1875ad134d60ea68a0e.zip |
issue #553 - negative birthday from directory. This may not completely fix it and may take a profile update to register the change; but it's a start; specifically we need to store 0000-00-00 in the xprof table of the directory server if that's what we get over the wire. Birthday fields are string and are not subject to SQL strict_mode on dates. We want these to be the string '0000-00-00' if not set to a valid date.
-rw-r--r-- | include/zot.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php index 1df600abd..572cbaef8 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2576,7 +2576,7 @@ function import_directory_profile($hash, $profile, $addr, $ud_flags = UPDATE_FLA $arr = array(); $arr['xprof_hash'] = $hash; - $arr['xprof_dob'] = datetime_convert('','',$profile['birthday'],'Y-m-d'); // !!!! check this for 0000 year + $arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year $arr['xprof_age'] = (($profile['age']) ? intval($profile['age']) : 0); $arr['xprof_desc'] = (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : ''); $arr['xprof_gender'] = (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : ''); |