define('FRIENDICA_CODENAME', 'Asparagus');
define('FRIENDICA_VERSION', '3.6-dev');
define('DFRN_PROTOCOL_VERSION', '2.23');
-define('DB_UPDATE_VERSION', 1245);
+define('DB_UPDATE_VERSION', 1246);
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/**
-- ------------------------------------------
-- Friendica 3.6-dev (Asparagus)
--- DB_UPDATE_VERSION 1244
+-- DB_UPDATE_VERSION 1246
-- ------------------------------------------
`hide-friends` boolean NOT NULL DEFAULT '0' COMMENT '',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`pdesc` varchar(255) NOT NULL DEFAULT '' COMMENT '',
- `dob` varchar(32) NOT NULL DEFAULT '0001-01-01' COMMENT '',
+ `dob` varchar(32) NOT NULL DEFAULT '0000-00-00' COMMENT '',
`address` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`locality` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`region` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`guid` varchar(64) NOT NULL DEFAULT '' COMMENT '',
`username` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
- `legacy_password` boolean NOT NULL DEFAULT 0 COMMENT 'Is the password hash double-hashed?',
+ `legacy_password` boolean NOT NULL DEFAULT '0' COMMENT 'Is the password hash double-hashed?',
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`email` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`openid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
{
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
- if ($dob <= '0001-01-01') {
+ if ($dob < '0000-01-01') {
$value = '';
} else {
- $value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d'));
+ $value = (($year > 1000) ? datetime_convert('UTC', 'UTC', $dob, 'Y-m-d') : datetime_convert('UTC', 'UTC', '1000-' . $month . '-'. $day, 'm-d'));
}
- $age = ((intval($value)) ? age($value, $a->user["timezone"], $a->user["timezone"]) : "");
+ $age = (intval($value) ? age($value, $a->user["timezone"], $a->user["timezone"]) : "");
$o = replace_macros(get_markup_template("field_input.tpl"), [
'$field' => [
]
]);
- /// @TODO Old-lost code?
-// if ($dob && $dob > '0001-01-01')
-// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year), 'dob');
-// else
-// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob');
-
return $o;
}
return;
}
- $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0001-01-01'; // FIXME: Needs to be validated?
+ $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0000-00-00';
$y = substr($dob, 0, 4);
if ((! ctype_digit($y)) || ($y < 1900)) {
$dob = datetime_convert('UTC', 'UTC', (($ignore_year) ? '1900-' . $dob : $dob), (($ignore_year) ? 'm-d' : 'Y-m-d'));
if ($ignore_year) {
- $dob = '0001-' . $dob;
+ $dob = '0000-' . $dob;
}
}
"hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
- "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""],
+ "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => ""],
"address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
$searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false');
if ($searchable === 'true') {
- $dob = '1000-00-00';
+ $dob = '';
- if (($profile['dob']) && ($profile['dob'] > '0001-01-01')) {
- $dob = ((intval($profile['dob'])) ? intval($profile['dob']) : '1000') .'-'. datetime_convert('UTC', 'UTC', $profile['dob'],'m-d');
+ if ($profile['dob'] && ($profile['dob'] > '0000-00-00')) {
+ list($year, $month, $day) = sscanf($profile['dob'], '%4d-%2d-%2d');
+ if ($year < 1004) {
+ $year = 1004;
+ }
+ $dob = datetime_convert('UTC', 'UTC', $year . '-' . $month . '-'. $day, 'Y-m-d');
}
$about = $profile['about'];
foreach ($recips as $recip) {
logger("Send updated profile data for user ".$uid." to contact ".$recip["id"], LOGGER_DEBUG);
- self::buildAndTransmit($owner, $recip, "profile", $message, false, "", true);
+ self::buildAndTransmit($owner, $recip, "profile", $message, false, "", false);
}
}