]> git.mxchange.org Git - friendica.git/commitdiff
Attempt anonymous
authorAdam Magness <adam.magness@gmail.com>
Sat, 13 Jan 2018 18:08:18 +0000 (13:08 -0500)
committerAdam Magness <adam.magness@gmail.com>
Sat, 13 Jan 2018 18:08:18 +0000 (13:08 -0500)
Try anonymous function based on review suggestion.

src/Core/UserImport.php

index 3557b12cb8f115d56e2d92d6f9dde7b4ff340d3a..8b259b2dbe51fa705e15e51e72c92e64b290428d 100644 (file)
@@ -155,9 +155,11 @@ class UserImport
                unset($account['user']['account_expires_on']);
                unset($account['user']['expire_notification_sent']);
 
-               foreach ($account['user'] as $k => &$v) {
-                       $v = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $v);
-               }
+               $callback = function ($key, $value) use ($oldbaseurl, $oldaddr, $newbaseurl, $newaddr) {
+                       return str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $value);
+               };
+
+               $v = array_map($account['user'], $callback);
 
                // import user
                $r = self::dbImportAssoc('user', $account['user']);