aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1215.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-05-26 21:15:22 +0200
committerMario <mario@mariovavti.com>2018-06-08 09:41:35 +0200
commit752a9d904c99dda79e6c67068cdd970a29946b58 (patch)
treed2921baae6f330eb4f03f38fa5f09f7940aabf47 /Zotlabs/Update/_1215.php
parenta5b9fbaf00bb59016d54407731712b15803af983 (diff)
downloadvolse-hubzilla-752a9d904c99dda79e6c67068cdd970a29946b58.tar.gz
volse-hubzilla-752a9d904c99dda79e6c67068cdd970a29946b58.tar.bz2
volse-hubzilla-752a9d904c99dda79e6c67068cdd970a29946b58.zip
DB update to fix wrong hubloc_url for activitypub hublocs
(cherry picked from commit eb04dbc5ce2321ca5da4274005bd3e4352cf83fa)
Diffstat (limited to 'Zotlabs/Update/_1215.php')
-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;
+ }
+ }
+
+}