summaryrefslogtreecommitdiff
path: root/report.php
blob: c55d0d93d3bcf462b42c73051893b4fd91591128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
include 'inc/functions.php';
$global = isset($_GET['global']);
$post = ($_GET['post'] ?? false);
$board = ($_GET['board'] ?? false);

if (!$post || !preg_match('/^delete_\d+$/', (string) $post) || !$board || !openBoard($board)) {
	header('HTTP/1.1 400 Bad Request');
	error(_('Bad request.'));
}

if ($config['report_captcha']) {
	$captcha = generate_captcha($config['captcha']['extra']);
} else {
	$captcha = null;
}

$body = Element('report.html', ['global' => $global, 'post' => $post, 'board' => $board, 'captcha' => $captcha, 'config' => $config]);
echo Element('page.html', ['config' => $config, 'body' => $body]);