added suggestions

This commit is contained in:
Philipp Holzer 2019-05-26 21:53:24 +02:00
parent 220f8f0862
commit 26d4214c19
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
2 changed files with 4 additions and 3 deletions

View file

@ -12,6 +12,7 @@ use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
function uexport_init(App $a) {
/// @todo Don't forget to move this global field as static field in src/Modules
global $dbStructure;
if (!local_user()) {
@ -74,7 +75,7 @@ function _uexport_multirow($query) {
foreach ($rr as $k => $v) {
switch ($dbStructure[$table]['fields'][$k]['type']) {
case 'datetime':
$p[$k] = !empty($v) ? $v : DBA::NULL_DATETIME;
$p[$k] = $v ?? DBA::NULL_DATETIME;
break;
default:
$p[$k] = $v;
@ -101,7 +102,7 @@ function _uexport_row($query) {
foreach ($rr as $k => $v) {
switch ($dbStructure[$table]['fields'][$k]['type']) {
case 'datetime':
$result[$k] = !empty($v) ? $v : DBA::NULL_DATETIME;
$result[$k] = $v ?? DBA::NULL_DATETIME;
break;
default:
$result[$k] = $v;

View file

@ -53,7 +53,7 @@ class UserImport
}
if ($ttype[$icol] === 'datetime') {
$arr[$icol] = !empty($ival) ? $ival : DBA::NULL_DATETIME;
$arr[$icol] = $ival ?? DBA::NULL_DATETIME;
}
}
}