Skip to content

Commit

Permalink
MDL-73317 search: Close session later in script
Browse files Browse the repository at this point in the history
The session write_close was moved to the earliest point in the script
that does not modify the session. This is currently always after
$OUTPUT->header()
  • Loading branch information
matthewhilton committed Feb 9, 2023
1 parent 49c4cfb commit f106bab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
require_login();
}

// Unlock the session during a search.
\core\session\manager::write_close();

require_capability('moodle/search:query', $context);

$searchrenderer = $PAGE->get_renderer('core_search');
Expand Down Expand Up @@ -169,6 +166,9 @@
// We are ready to render.
echo $OUTPUT->header();

// Unlock the session only after outputting the header as this modifies the session cachestore.
\core\session\manager::write_close();

// Get the results.
if ($data) {
$results = $search->paged_search($data, $page);
Expand Down

0 comments on commit f106bab

Please sign in to comment.