From 39458b2ba8d5330770e90831babb4924ab116454 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 30 Nov 2021 10:50:31 +0100 Subject: fix hubloc_site_id in fix_system_urls() on detected site rename events and during sync_locations() if it changed or was stored incorrectly. --- boot.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 6aba5e4be..81533462d 100644 --- a/boot.php +++ b/boot.php @@ -29,6 +29,8 @@ // composer autoloader for all namespaced Classes use Zotlabs\Lib\Crypto; +use Zotlabs\Lib\Libzot; +use Zotlabs\Lib\Config; require_once('vendor/autoload.php'); @@ -1527,8 +1529,6 @@ function check_config() { function fix_system_urls($oldurl, $newurl) { - require_once('include/crypto.php'); - logger('fix_system_urls: renaming ' . $oldurl . ' to ' . $newurl); // Basically a site rename, but this can happen if you change from http to https for instance - even if the site name didn't change @@ -1538,7 +1538,7 @@ function fix_system_urls($oldurl, $newurl) { // that they can clean up their hubloc tables (this includes directories). // It's a very expensive operation so you don't want to have to do it often or after your site gets to be large. - $r = q("select xchan.*, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_url like '%s'", + $r = q("select xchan.*, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_url like '%s' and hubloc_network = 'zot6'", dbesc($oldurl . '%') ); @@ -1586,13 +1586,14 @@ function fix_system_urls($oldurl, $newurl) { dbesc($rv['xchan_hash']) ); - $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'", + $y = q("update hubloc set hubloc_addr = '%s', hubloc_url = '%s', hubloc_id_url = '%s', hubloc_url_sig = '%s', hubloc_site_id = '%s', hubloc_host = '%s', hubloc_callback = '%s' where hubloc_hash = '%s' and hubloc_url = '%s'", dbesc($channel_address . '@' . $rhs), dbesc($newurl), - 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(Crypto::sign($newurl,$c[0]['channel_prvkey']))), + dbesc(str_replace($oldurl, $newurl,$rv['hubloc_id_url'])), + dbesc(Libzot::sign($newurl, $c[0]['channel_prvkey'])), + dbesc(Libzot::make_xchan_hash($newurl, Config::Get('system','pubkey'))), dbesc($newhost), - dbesc(($rv['hubloc_network'] === 'zot6') ? $newurl . '/zot' : $newurl . '/post'), + dbesc($newurl . '/zot'), dbesc($rv['xchan_hash']), dbesc($oldurl) ); -- cgit v1.2.3 From 60b145833c5c07898363d51838a942b876f60c3c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 3 Dec 2021 13:45:19 +0100 Subject: changelog and version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 81533462d..607d64e60 100644 --- a/boot.php +++ b/boot.php @@ -55,7 +55,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '6.5' ); +define ( 'STD_VERSION', '6.5.1' ); define ( 'ZOT_REVISION', '6.0' ); define ( 'DB_UPDATE_VERSION', 1248 ); -- cgit v1.2.3