aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--Zotlabs/Update/_1215.php26
-rwxr-xr-xboot.php2
2 files changed, 27 insertions, 1 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;
+ }
+ }
+
+}
diff --git a/boot.php b/boot.php
index 9b3b86381..c0d749c2e 100755
--- a/boot.php
+++ b/boot.php
@@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.5.6' );
define ( 'ZOT_REVISION', '6.0a' );
-define ( 'DB_UPDATE_VERSION', 1214 );
+define ( 'DB_UPDATE_VERSION', 1215 );
define ( 'PROJECT_BASE', __DIR__ );