]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/UserImport.php
friendica-6950 uimport doesn't support `"pwdreset_time":null`
[friendica.git] / src / Core / UserImport.php
index 0a4223fecdf5f45241051631dcb23a0c5d10aab2..8d02fb420e2143f34d88672dc0f0ab548e1e66f2 100644 (file)
@@ -39,14 +39,21 @@ class UserImport
                $tableColumns = DBStructure::getColumns($table);
 
                $tcols = [];
+               $ttype = [];
                // get a plain array of column names
                foreach ($tableColumns as $tcol) {
                        $tcols[] = $tcol['Field'];
+                       $ttype[$tcol['Field']] = $tcol['Type'];
                }
                // remove inexistent columns
                foreach ($arr as $icol => $ival) {
                        if (!in_array($icol, $tcols)) {
                                unset($arr[$icol]);
+                               continue;
+                       }
+
+                       if ($ttype[$icol] === 'datetime') {
+                               $arr[$icol] = !empty($ival) ? $ival : DBA::NULL_DATETIME;
                        }
                }
        }