Avoid storing "null" values
This commit is contained in:
parent
e2f5350e61
commit
8700d2a8ad
|
@ -2079,8 +2079,8 @@ class DFRN
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['title' => $item["title"], 'body' => $item["body"],
|
$fields = ['title' => defaults($item["title"], ''), 'body' => defaults($item["body"], ''),
|
||||||
'tag' => $item["tag"], 'changed' => DateTimeFormat::utcNow(),
|
'tag' => defaults($item["tag"], ''), 'changed' => DateTimeFormat::utcNow(),
|
||||||
'edited' => DateTimeFormat::utc($item["edited"])];
|
'edited' => DateTimeFormat::utc($item["edited"])];
|
||||||
|
|
||||||
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
|
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
|
||||||
|
|
|
@ -1355,11 +1355,12 @@ class PortableContact
|
||||||
$info = strip_tags($info);
|
$info = strip_tags($info);
|
||||||
$platform = strip_tags($platform);
|
$platform = strip_tags($platform);
|
||||||
|
|
||||||
$fields = ['url' => $server_url, 'version' => $version,
|
$fields = ['url' => $server_url, 'version' => defaults($version, ''),
|
||||||
'site_name' => $site_name, 'info' => $info, 'register_policy' => $register_policy,
|
'site_name' => defaults($site_name, ''), 'info' => defaults($info, ''),
|
||||||
'poco' => $poco, 'noscrape' => $noscrape, 'network' => $network,
|
'register_policy' => defaults($register_policy, 0), 'poco' => defaults($poco, ''),
|
||||||
'platform' => $platform, 'registered-users' => $registered_users,
|
'noscrape' => defaults($noscrape, ''), 'network' => defaults($network, ''),
|
||||||
'last_contact' => $last_contact, 'last_failure' => $last_failure];
|
'platform' => defaults($platform, ''), 'registered-users' => defaults($registered_users, 0),
|
||||||
|
'last_contact' => defaults($last_contact, ''), 'last_failure' => defaults($last_failure, '')];
|
||||||
|
|
||||||
if ($found) {
|
if ($found) {
|
||||||
dba::update('gserver', $fields, ['nurl' => normalise_link($server_url)]);
|
dba::update('gserver', $fields, ['nurl' => normalise_link($server_url)]);
|
||||||
|
|
Loading…
Reference in a new issue