diff options
author | Mario Vavti <mario@mariovavti.com> | 2020-08-23 19:17:23 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2020-08-23 19:17:23 +0200 |
commit | c53794a8a2bd4c6100d4c5f8e7785c8436b454fa (patch) | |
tree | c3eefbf7d7f3bb0d926f0136ebf01eaf42d8023d /Zotlabs/Module/Fhubloc_id_url.php | |
parent | 170b2e4465951edff5019545045714aa660cad51 (diff) | |
download | volse-hubzilla-c53794a8a2bd4c6100d4c5f8e7785c8436b454fa.tar.gz volse-hubzilla-c53794a8a2bd4c6100d4c5f8e7785c8436b454fa.tar.bz2 volse-hubzilla-c53794a8a2bd4c6100d4c5f8e7785c8436b454fa.zip |
an attempt to fix update 1238 for older hubs with broken xchan entries
Diffstat (limited to 'Zotlabs/Module/Fhubloc_id_url.php')
-rw-r--r-- | Zotlabs/Module/Fhubloc_id_url.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Zotlabs/Module/Fhubloc_id_url.php b/Zotlabs/Module/Fhubloc_id_url.php index d332c7400..1ecb6f1e0 100644 --- a/Zotlabs/Module/Fhubloc_id_url.php +++ b/Zotlabs/Module/Fhubloc_id_url.php @@ -9,7 +9,10 @@ class Fhubloc_id_url extends \Zotlabs\Web\Controller { if(! is_site_admin()) return; - + + // completely remove broken xchan entries + $r = dbq("DELETE FROM xchan WHERE xchan_hash = ''"); + // fix legacy zot hubloc_id_url $r1 = dbq("UPDATE hubloc SET hubloc_id_url = CONCAT(hubloc_url, '/channel/', SUBSTRING(hubloc_addr FROM 1 FOR POSITION('@' IN hubloc_addr) -1)) @@ -23,8 +26,7 @@ class Fhubloc_id_url extends \Zotlabs\Web\Controller { $r2 = dbq("UPDATE xchan SET xchan_url = xchan_hash WHERE xchan_network = 'activitypub' - AND xchan_url = '' - AND xchan_hash != ''" + AND xchan_url = ''" ); $r3 = dbq("UPDATE hubloc @@ -40,8 +42,7 @@ class Fhubloc_id_url extends \Zotlabs\Web\Controller { $r2 = dbq("UPDATE xchan SET xchan_url = xchan_hash WHERE xchan_network = 'activitypub' - AND xchan_url = '' - AND xchan_hash != ''" + AND xchan_url = ''" ); $r3 = dbq("UPDATE hubloc |