mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
post.php, mod.php: pass the context to check_login
This commit is contained in:
parent
e6133ef00f
commit
f4ff39c876
7
mod.php
7
mod.php
@ -11,7 +11,10 @@ if ($config['debug']) {
|
||||
|
||||
require_once 'inc/mod/pages.php';
|
||||
|
||||
check_login(true);
|
||||
|
||||
$ctx = Vichan\build_context($config);
|
||||
|
||||
check_login($ctx, true);
|
||||
|
||||
$query = isset($_SERVER['QUERY_STRING']) ? rawurldecode($_SERVER['QUERY_STRING']) : '';
|
||||
|
||||
@ -136,8 +139,6 @@ 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[0] = $ctx; // Replace the text captured by the full pattern with a reference to the context.
|
||||
|
Loading…
Reference in New Issue
Block a user