diff --git a/Sources/PersonalMessage/PM.php b/Sources/PersonalMessage/PM.php index 058ec72dc0..24873e6a85 100644 --- a/Sources/PersonalMessage/PM.php +++ b/Sources/PersonalMessage/PM.php @@ -531,9 +531,8 @@ public static function get($ids, array $query_customizations = []) $limit = $query_customizations['limit'] ?? count($ids); $params = $query_customizations['params'] ?? []; - if (!empty($ids)) { - $params['ids'] = array_filter(array_unique(array_map('intval', $ids))); - } + // There will never be an ID 0, but SMF doesn't like empty arrays when you tell it to expect an array of integers... + $params['ids'] = empty($ids) ? [0] : array_filter(array_unique(array_map('intval', $ids))); foreach(self::queryData($selects, $params, $joins, $where, $order, $group, $limit) as $row) { $id = (int) $row['id_pm']; diff --git a/Sources/PersonalMessage/Popup.php b/Sources/PersonalMessage/Popup.php index 22b10cbc04..a15e9a1f63 100644 --- a/Sources/PersonalMessage/Popup.php +++ b/Sources/PersonalMessage/Popup.php @@ -65,7 +65,7 @@ public function show(): void } // Now, actually fetch me some PMs. - foreach (PM::load($pms, false) as $pm) { + foreach (PM::load($pms) as $pm) { // Make sure we track the senders. We have some work to do for them. if (!empty($pm->member_from)) { $senders[] = $pm->member_from; diff --git a/Sources/PersonalMessage/Received.php b/Sources/PersonalMessage/Received.php index 7f20c3b537..495e56b7a2 100644 --- a/Sources/PersonalMessage/Received.php +++ b/Sources/PersonalMessage/Received.php @@ -524,6 +524,8 @@ public static function getRecent(int $label = -1, string $sort = 'pmr.id_pm', bo return self::$recent[$paramskey]; } + self::$recent[$paramskey] = []; + $joins = []; $where = [ diff --git a/Sources/PersonalMessage/Search.php b/Sources/PersonalMessage/Search.php index 7db2d838aa..3a3ddf7062 100644 --- a/Sources/PersonalMessage/Search.php +++ b/Sources/PersonalMessage/Search.php @@ -321,7 +321,7 @@ public function performSearch(): void // Sort out the page index. Utils::$context['page_index'] = new PageIndex( Config::$scripturl . '?action=pm;sa=search2;params=' . $this->compressed_params, - $_GET['start'], + (int) ($_GET['start'] ?? 0), Utils::$context['num_results'], $this->per_page, false,