X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FUserImport.php;h=efd4bd2f8fea963872d79b467118be380903d7d1;hb=09338d774b254d4adba088a01a96cc597de05905;hp=459dde890810a2178c75a841761f71d02503a97c;hpb=af6dbc654f82225cfc647fe2072662acae388e47;p=friendica.git diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index 459dde8908..efd4bd2f8f 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -35,7 +35,7 @@ class UserImport */ private static function checkCols($table, &$arr) { - $query = sprintf("SHOW COLUMNS IN `%s`", dbesc($table)); + $query = sprintf("SHOW COLUMNS IN `%s`", DBA::escape($table)); logger("uimport: $query", LOGGER_DEBUG); $r = q($query); $tcols = []; @@ -64,8 +64,8 @@ class UserImport } self::checkCols($table, $arr); - $cols = implode("`,`", array_map('dbesc', array_keys($arr))); - $vals = implode("','", array_map('dbesc', array_values($arr))); + $cols = implode("`,`", array_map(['Friendica\Database\DBA', 'escape'], array_keys($arr))); + $vals = implode("','", array_map(['Friendica\Database\DBA', 'escape'], array_values($arr))); $query = "INSERT INTO `$table` (`$cols`) VALUES ('$vals')"; logger("uimport: $query", LOGGER_TRACE); @@ -142,7 +142,7 @@ class UserImport // import user $r = self::dbImportAssoc('user', $account['user']); if ($r === false) { - logger("uimport:insert user : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert user : ERROR : " . DBA::errorMessage(), LOGGER_INFO); notice(L10n::t("User creation error")); return; } @@ -160,7 +160,7 @@ class UserImport $profile['uid'] = $newuid; $r = self::dbImportAssoc('profile', $profile); if ($r === false) { - logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO); info(L10n::t("User profile creation error")); DBA::delete('user', ['uid' => $newuid]); return; @@ -198,7 +198,7 @@ class UserImport $contact['uid'] = $newuid; $r = self::dbImportAssoc('contact', $contact); if ($r === false) { - logger("uimport:insert contact " . $contact['nick'] . "," . $contact['network'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert contact " . $contact['nick'] . "," . $contact['network'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO); $errorcount++; } else { $contact['newid'] = self::lastInsertId(); @@ -212,7 +212,7 @@ class UserImport $group['uid'] = $newuid; $r = self::dbImportAssoc('group', $group); if ($r === false) { - logger("uimport:insert group " . $group['name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert group " . $group['name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO); } else { $group['newid'] = self::lastInsertId(); } @@ -237,7 +237,7 @@ class UserImport if ($import == 2) { $r = self::dbImportAssoc('group_member', $group_member); if ($r === false) { - logger("uimport:insert group member " . $group_member['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert group member " . $group_member['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO); } } } @@ -255,7 +255,7 @@ class UserImport ); if ($r === false) { - logger("uimport:insert photo " . $photo['resource-id'] . "," . $photo['scale'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert photo " . $photo['resource-id'] . "," . $photo['scale'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO); } } @@ -263,7 +263,7 @@ class UserImport $pconfig['uid'] = $newuid; $r = self::dbImportAssoc('pconfig', $pconfig); if ($r === false) { - logger("uimport:insert pconfig " . $pconfig['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL); + logger("uimport:insert pconfig " . $pconfig['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO); } }