aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-05-26 21:15:22 +0200
committerMario Vavti <mario@mariovavti.com>2018-05-26 21:15:22 +0200
commiteb04dbc5ce2321ca5da4274005bd3e4352cf83fa (patch)
treec713bcd94dc17190718627fb8b2549a46924f6c4 /Zotlabs
parent33700e9cf47e2b5f0b4597772d9cea81e811bae3 (diff)
downloadvolse-hubzilla-eb04dbc5ce2321ca5da4274005bd3e4352cf83fa.tar.gz
volse-hubzilla-eb04dbc5ce2321ca5da4274005bd3e4352cf83fa.tar.bz2
volse-hubzilla-eb04dbc5ce2321ca5da4274005bd3e4352cf83fa.zip
DB update to fix wrong hubloc_url for activitypub hublocs
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Update/_1215.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1215.php b/Zotlabs/Update/_1215.php
new file mode 100644
index 000000000..3acaab587
--- /dev/null
+++ b/Zotlabs/Update/_1215.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1215 {
+
+ function run() {
+ q("START TRANSACTION");
+
+ // this will fix mastodon hubloc_url
+ $r1 = q("UPDATE hubloc SET hubloc_url = LEFT(hubloc_url, POSITION('/users' IN hubloc_url)-1) WHERE POSITION('/users' IN hubloc_url)>0");
+
+ // this will fix peertube hubloc_url
+ $r2 = q("UPDATE hubloc SET hubloc_url = LEFT(hubloc_url, POSITION('/account' IN hubloc_url)-1) WHERE POSITION('/account' IN hubloc_url)>0");
+
+ if($r1 && $r2) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+ else {
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+ }
+ }
+
+}