From 8be6989bd198d848ab5be743d475730012bb7894 Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Sun, 14 Jan 2018 15:56:36 -0500 Subject: [PATCH] Review updates self:: const and fix up callback function and array_walk --- src/Core/UserImport.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index 2c41fb27b0..5ad4f57779 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -24,7 +24,7 @@ class UserImport private static function lastInsertId() { - if (IMPORT_DEBUG) { + if (self::IMPORT_DEBUG) { return 1; } @@ -73,7 +73,7 @@ class UserImport $query = "INSERT INTO `$table` (`$cols`) VALUES ('$vals')"; logger("uimport: $query", LOGGER_TRACE); - if (IMPORT_DEBUG) { + if (self::IMPORT_DEBUG) { return true; } @@ -155,11 +155,11 @@ class UserImport unset($account['user']['account_expires_on']); unset($account['user']['expire_notification_sent']); - $callback = function ($key, $value) use ($oldbaseurl, $oldaddr, $newbaseurl, $newaddr) { - return str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $value); + $callback = function (&$value) use ($oldbaseurl, $oldaddr, $newbaseurl, $newaddr) { + $value = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $value); }; - $v = array_map($account['user'], $callback); + array_walk($account['user'], $callback); // import user $r = self::dbImportAssoc('user', $account['user']);