1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

post.php, mod.php: pass the context to check_login

This commit is contained in:
Zankaria 2024-10-01 22:15:03 +02:00
parent e6133ef00f
commit f4ff39c876
2 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -694,7 +694,7 @@ if (isset($_POST['delete'])) {
if ($post['mod'] = isset($_POST['mod']) && $_POST['mod']) {
check_login(false);
check_login($context, false);
if (!$mod) {
// Liar. You're not a mod.
error($config['error']['notamod']);