aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Fhubloc_id_url.php11
-rw-r--r--Zotlabs/Update/_1238.php9
2 files changed, 11 insertions, 9 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
diff --git a/Zotlabs/Update/_1238.php b/Zotlabs/Update/_1238.php
index 32c21f161..2a10e594f 100644
--- a/Zotlabs/Update/_1238.php
+++ b/Zotlabs/Update/_1238.php
@@ -12,6 +12,9 @@ class _1238 {
dbesc('Premium Channel')
);
+ // 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))
@@ -25,8 +28,7 @@ class _1238 {
$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
@@ -41,8 +43,7 @@ class _1238 {
$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