mod.php: pass the context to the mod pages

This commit is contained in:
Zankaria
2024-08-15 17:05:43 +02:00
parent 19082aec56
commit 524ae94624
2 changed files with 80 additions and 80 deletions

View File

@@ -136,9 +136,11 @@ foreach ($pages as $key => $callback) {
}
$pages = $new_pages;
$ctx = Vichan\build_context($config);
foreach ($pages as $uri => $handler) {
if (preg_match($uri, $query, $matches)) {
$matches = array_slice($matches, 1);
$matches[0] = $ctx; // Replace the text captured by the full pattern with a reference to the context.
if (isset($matches['board'])) {
$board_match = $matches['board'];