aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-08 08:43:00 +0000
committerMario <mario@mariovavti.com>2021-05-08 08:43:00 +0000
commit09cfc979e4bbdd272f7852b75d02366780358c6e (patch)
treeda163b73080226479fdbb203c0ee4e4a04efd782
parent36a814b03ec11d25aa5eb4e02e6dfc50e2c8c6b3 (diff)
parent954d06bdb7c8ef9f73f799eec72fcbd8bbc56b9f (diff)
downloadvolse-hubzilla-09cfc979e4bbdd272f7852b75d02366780358c6e.tar.gz
volse-hubzilla-09cfc979e4bbdd272f7852b75d02366780358c6e.tar.bz2
volse-hubzilla-09cfc979e4bbdd272f7852b75d02366780358c6e.zip
Merge branch 'dev' into 5.6RC
-rw-r--r--Zotlabs/Lib/Activity.php4
-rw-r--r--Zotlabs/Update/_1245.php29
-rw-r--r--boot.php2
-rw-r--r--include/account.php7
-rw-r--r--install/schema_postgres.sql7
5 files changed, 39 insertions, 10 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index e036c7b1e..6e8344def 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -132,8 +132,8 @@ class Activity {
}
static function fetch_profile($x) {
- $r = q("select * from xchan where xchan_url like '%s' limit 1",
- dbesc($x['id'] . '/%')
+ $r = q("select * from xchan where xchan_url = '%s' limit 1",
+ dbesc($x['id'])
);
if (!$r) {
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
diff --git a/Zotlabs/Update/_1245.php b/Zotlabs/Update/_1245.php
new file mode 100644
index 000000000..8212fde08
--- /dev/null
+++ b/Zotlabs/Update/_1245.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1245 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ return UPDATE_SUCCESS;
+ }
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ q("START TRANSACTION");
+
+ $r = dbq("create index hubloc_hash on hubloc (hubloc_hash)");
+
+ if($r) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+ }
+
+ }
+
+}
diff --git a/boot.php b/boot.php
index 3b1d23150..d22dfb372 100644
--- a/boot.php
+++ b/boot.php
@@ -55,7 +55,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '5.6RC2' );
define ( 'ZOT_REVISION', '6.0' );
-define ( 'DB_UPDATE_VERSION', 1244 );
+define ( 'DB_UPDATE_VERSION', 1245 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/include/account.php b/include/account.php
index 6643f0988..d138dab41 100644
--- a/include/account.php
+++ b/include/account.php
@@ -875,9 +875,9 @@ function verify_register_scheme() {
. "reg_did2 text DEFAULT '' NOT NULL,"
. "reg_hash text DEFAULT '' NOT NULL,"
. "reg_email text DEFAULT '' NOT NULL,"
- . "reg_created timestamp NOT NULL,"
- . "reg_startup timestamp NOT NULL,"
- . "reg_expires timestamp NOT NULL,"
+ . "reg_created timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',"
+ . "reg_startup timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',"
+ . "reg_expires timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',"
. "reg_byc bigint DEFAULT 0 NOT NULL,"
. "reg_uid bigint DEFAULT 0 NOT NULL,"
. "reg_atip text DEFAULT '' NOT NULL,"
@@ -1295,7 +1295,6 @@ function get_pending_accounts($get_all = false) {
}
function remove_expired_registrations() {
- hz_syslog('### expire reg', LOGGER_DEBUG);
q("DELETE FROM register WHERE (reg_expires < '%s' OR reg_expires = '%s') AND (reg_flags & %d) > 0",
dbesc(datetime_convert()),
dbesc(NULL_DATE),
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 52b44bd07..c18cc087b 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -506,6 +506,7 @@ CREATE TABLE "hubloc" (
create index "hubloc_url" on hubloc ("hubloc_url");
create index "hubloc_site_id" on hubloc ("hubloc_site_id");
create index "hubloc_guid" on hubloc ("hubloc_guid");
+create index "hubloc_hash" on hubloc ("hubloc_hash");
create index "hubloc_id_url" on hubloc ("hubloc_id_url");
create index "hubloc_flags" on hubloc ("hubloc_flags");
create index "hubloc_connect" on hubloc ("hubloc_connect");
@@ -1099,9 +1100,9 @@ CREATE TABLE "register" (
"reg_did2" text DEFAULT '' NOT NULL,
"reg_hash" text DEFAULT '' NOT NULL,
"reg_email" text DEFAULT '' NOT NULL,
- "reg_created" timestamp NOT NULL,
- "reg_startup" timestamp NOT NULL,
- "reg_expires" timestamp NOT NULL,
+ "reg_created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "reg_startup" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "reg_expires" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"reg_byc" bigint DEFAULT 0 NOT NULL,
"reg_uid" bigint DEFAULT 0 NOT NULL,
"reg_atip" text DEFAULT '' NOT NULL,