forked from leftypol/leftypol
mod.php, pages.php: pass the context to the mod pages
This commit is contained in:
parent
cb71e00b50
commit
7ef2d42bb0
2 changed files with 80 additions and 77 deletions
4
mod.php
4
mod.php
|
@ -148,9 +148,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'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue