Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Sources/PersonalMessage/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,11 @@ public function performSearch(): void
// Load the users...
User::load(Utils::$context['posters']);

// Sort out the page index.
$start = (int) ($_GET['start'] ?? 0);
// Sort out the page index. PageIndex takes this by reference and clamps
// it, so hand it a copy of what was asked for and keep the original to
// compare against. Reading $_GET again here instead is what left the
// line below unguarded, since a search arrives without a start.
$start = $this->start;
Utils::$context['page_index'] = new PageIndex(
Config::$scripturl . '?action=pm;sa=search2;params=' . $this->compressed_params,
$start,
Expand All @@ -329,7 +332,7 @@ public function performSearch(): void
);

// If the supplied start value was invalid, redirect to the correct one.
if ($_GET['start'] != $start) {
if ($this->start != $start) {
Utils::redirectexit(Utils::$context['page_index']->base_url . ';start=' . $start);
}

Expand Down