$oldbaseurl = $account['baseurl'];
$newbaseurl = System::baseUrl();
+
+ $oldaddr = str_replace('http://', '@', normalise_link($oldbaseurl));
+ $newaddr = str_replace('http://', '@', normalise_link($newbaseurl));
+
$olduid = $account['user']['uid'];
unset($account['user']['uid']);
unset($account['user']['expire_notification_sent']);
foreach ($account['user'] as $k => &$v) {
- $v = str_replace($oldbaseurl, $newbaseurl, $v);
+ $v = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $v);
}
// import user
foreach ($account['profile'] as &$profile) {
foreach ($profile as $k => &$v) {
- $v = str_replace($oldbaseurl, $newbaseurl, $v);
+ $v = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $v);
foreach (array("profile", "avatar") as $k) {
$v = str_replace($oldbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);
}
foreach ($account['contact'] as &$contact) {
if ($contact['uid'] == $olduid && $contact['self'] == '1') {
foreach ($contact as $k => &$v) {
- $v = str_replace($oldbaseurl, $newbaseurl, $v);
+ $v = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $v);
foreach (array("profile", "avatar", "micro") as $k) {
$v = str_replace($oldbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);
}