From 3e2c684319303a300bb060747857f20cc3b78434 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Aug 2022 11:23:47 +0000 Subject: [PATCH] Some more index / fatal erros fixed --- database.sql | 1 + doc/database/db_post-user.md | 1 + src/Content/Pager.php | 2 +- src/Module/Update/Profile.php | 2 +- static/dbstructure.config.php | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/database.sql b/database.sql index 40abb7f056..e363dd57dd 100644 --- a/database.sql +++ b/database.sql @@ -1416,6 +1416,7 @@ CREATE TABLE IF NOT EXISTS `post-user` ( INDEX `author-id_uid` (`author-id`,`uid`), INDEX `author-id_received` (`author-id`,`received`), INDEX `parent-uri-id_uid` (`parent-uri-id`,`uid`), + INDEX `uid_wall_received` (`uid`,`wall`,`received`), INDEX `uid_contactid` (`uid`,`contact-id`), INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`), INDEX `uid_unseen` (`uid`,`unseen`), diff --git a/doc/database/db_post-user.md b/doc/database/db_post-user.md index 5fbc3e985a..ce213941da 100644 --- a/doc/database/db_post-user.md +++ b/doc/database/db_post-user.md @@ -60,6 +60,7 @@ Indexes | author-id_uid | author-id, uid | | author-id_received | author-id, received | | parent-uri-id_uid | parent-uri-id, uid | +| uid_wall_received | uid, wall, received | | uid_contactid | uid, contact-id | | uid_unseen_contactid | uid, unseen, contact-id | | uid_unseen | uid, unseen | diff --git a/src/Content/Pager.php b/src/Content/Pager.php index 98b885d425..f776249b1b 100644 --- a/src/Content/Pager.php +++ b/src/Content/Pager.php @@ -58,7 +58,7 @@ class Pager $this->setQueryString($queryString); $this->setItemsPerPage($itemsPerPage); - $this->setPage(($_GET['page'] ?? 0) ?: 1); + $this->setPage((int)($_GET['page'] ?? 0) ?: 1); } /** diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php index b97b9f89e5..50d0eddd14 100644 --- a/src/Module/Update/Profile.php +++ b/src/Module/Update/Profile.php @@ -40,7 +40,7 @@ class Profile extends BaseModule $a = DI::app(); // Ensure we've got a profile owner if updating. - $a->setProfileOwner($_GET['p'] ?? 0); + $a->setProfileOwner((int)($_GET['p'] ?? 0)); if (DI::config()->get('system', 'block_public') && !local_user() && !Session::getRemoteContactID($a->getProfileOwner())) { throw new ForbiddenException(); diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 81f03fbf31..aedb444667 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1443,6 +1443,7 @@ return [ "author-id_uid" => ["author-id", "uid"], "author-id_received" => ["author-id", "received"], "parent-uri-id_uid" => ["parent-uri-id", "uid"], + "uid_wall_received" => ["uid", "wall", "received"], "uid_contactid" => ["uid", "contact-id"], "uid_unseen_contactid" => ["uid", "unseen", "contact-id"], "uid_unseen" => ["uid", "unseen"],