diff options
author | Mario <mario@mariovavti.com> | 2020-12-17 12:27:49 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-12-17 12:27:49 +0000 |
commit | 4c054d6de9a6deec90f70f0c6ac67c9ec0e8f909 (patch) | |
tree | 6c6d732652cdf013d175b0107447a5ad8ae2c027 | |
parent | b2e80efe3f42c6329be7356580d62ea3525717b8 (diff) | |
parent | 34a58369f2c16a1c13b0ee2a6ab7418e72809d64 (diff) | |
download | volse-hubzilla-4c054d6de9a6deec90f70f0c6ac67c9ec0e8f909.tar.gz volse-hubzilla-4c054d6de9a6deec90f70f0c6ac67c9ec0e8f909.tar.bz2 volse-hubzilla-4c054d6de9a6deec90f70f0c6ac67c9ec0e8f909.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r-- | Zotlabs/Module/Owa.php | 4 | ||||
-rw-r--r-- | Zotlabs/Update/_1240.php | 34 | ||||
-rwxr-xr-x | boot.php | 4 |
3 files changed, 38 insertions, 4 deletions
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php index 0ed73c8c2..a974f2c1a 100644 --- a/Zotlabs/Module/Owa.php +++ b/Zotlabs/Module/Owa.php @@ -32,7 +32,7 @@ class Owa extends Controller { $keyId = $sigblock['keyId']; if ($keyId) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_deleted = 0", + WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_network IN ('zot6', 'zot')", dbesc(str_replace('acct:','',$keyId)), dbesc($keyId) ); @@ -40,7 +40,7 @@ class Owa extends Controller { $found = discover_by_webbie(str_replace('acct:','',$keyId)); if ($found) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_deleted = 0", + WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_network IN ('zot6', 'zot')", dbesc(str_replace('acct:','',$keyId)), dbesc($keyId) ); 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; + + } + +} @@ -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__ ); |