aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-12-17 13:27:11 +0100
committerMario Vavti <mario@mariovavti.com>2020-12-17 13:27:11 +0100
commit34a58369f2c16a1c13b0ee2a6ab7418e72809d64 (patch)
treeeb7ebec5e6d4a854a27ce9cefaefd0888290864f
parent59b4764a151ff6dc87f0c12b018961a7084ad040 (diff)
downloadvolse-hubzilla-34a58369f2c16a1c13b0ee2a6ab7418e72809d64.tar.gz
volse-hubzilla-34a58369f2c16a1c13b0ee2a6ab7418e72809d64.tar.bz2
volse-hubzilla-34a58369f2c16a1c13b0ee2a6ab7418e72809d64.zip
update to fix empty hubloc_id_url caused by clone import bug for zot hublocs which was fixed in 4693069a0618775167fd5c5b8c91b80f8a832da0
-rw-r--r--Zotlabs/Update/_1240.php34
-rwxr-xr-xboot.php4
2 files changed, 36 insertions, 2 deletions
diff --git a/Zotlabs/Update/_1240.php b/Zotlabs/Update/_1240.php
new file mode 100644
index 000000000..d007c9fa9
--- /dev/null
+++ b/Zotlabs/Update/_1240.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1240 {
+
+ function run() {
+
+ q("START TRANSACTION");
+
+ // remove broken xchan entries
+ $r0 = dbq("DELETE FROM xchan WHERE xchan_hash = ''");
+
+ // remove broken hubloc entries
+ $r1 = dbq("DELETE FROM hubloc WHERE hubloc_hash = ''");
+
+ // fix legacy zot hubloc_id_url
+ $r2 = dbq("UPDATE hubloc
+ SET hubloc_id_url = CONCAT(hubloc_url, '/channel/', SUBSTRING(hubloc_addr FROM 1 FOR POSITION('@' IN hubloc_addr) -1))
+ WHERE hubloc_network = 'zot'
+ AND hubloc_id_url = ''"
+ );
+
+ if($r0 && $r1 && $r2) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}
diff --git a/boot.php b/boot.php
index 10c1b4c91..3f56eb52a 100755
--- a/boot.php
+++ b/boot.php
@@ -50,10 +50,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
-define ( 'STD_VERSION', '5.1.9' );
+define ( 'STD_VERSION', '5.1.10' );
define ( 'ZOT_REVISION', '6.0' );
-define ( 'DB_UPDATE_VERSION', 1239 );
+define ( 'DB_UPDATE_VERSION', 1240 );
define ( 'PROJECT_BASE', __DIR__ );