From f8c583636cd3d5d6004cd0279ca887fa05fbf315 Mon Sep 17 00:00:00 2001 From: Zot Date: Fri, 26 Apr 2019 09:12:23 +0200 Subject: update fix_system_urls() to handle zot6 hublocs (recommend cherry-pick to master) --- boot.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 6664e80cf..6a52c2ca4 100755 --- a/boot.php +++ b/boot.php @@ -1507,12 +1507,13 @@ function fix_system_urls($oldurl, $newurl) { dbesc($rv['xchan_hash']) ); - $y = q("update hubloc set hubloc_addr = '%s', hubloc_url = '%s', hubloc_url_sig = '%s', hubloc_host = '%s', hubloc_callback = '%s' where hubloc_hash = '%s' and hubloc_url = '%s'", + $y = q("update hubloc set hubloc_addr = '%s', hubloc_url = '%s', hubloc_id_url = '%s', hubloc_url_sig = '%s', hubloc_host = '%s', hubloc_callback = '%s' where hubloc_hash = '%s' and hubloc_url = '%s'", dbesc($channel_address . '@' . $rhs), dbesc($newurl), - dbesc(base64url_encode(rsa_sign($newurl,$c[0]['channel_prvkey']))), + dbesc(str_replace($oldurl,$newurl,$rv['hubloc_id_url'])), + dbesc(($rv['hubloc_network'] === 'zot6') ? \Zotlabs\Lib\Libzot::sign($newurl,$c[0]['channel_prvkey']) : base64url_encode(rsa_sign($newurl,$c[0]['channel_prvkey']))), dbesc($newhost), - dbesc($newurl . '/post'), + dbesc(($rv['hubloc_network'] === 'zot6') ? $newurl . '/zot' : $newurl . '/post'), dbesc($rv['xchan_hash']), dbesc($oldurl) ); -- cgit v1.2.3