fix: return 403 if problem is used in a registered running contest
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-03 09:35:29 +08:00
parent ef774d2e97
commit 1ecf764bb7
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -12,6 +12,17 @@
become403Page();
}
$solutions = DB::selectAll("select * from problems_solutions where blog_id = {$blog['id']}");
if ($solutions) {
foreach ($solutions as $solution) {
$problem = queryProblemBrief($solution['problem_id']);
if (!hasProblemPermission($myUser, $problem) && isRegisteredRunningContestProblem($myUser, $problem)) {
become403Page();
}
}
}
if (!isset($_COOKIE['bootstrap4'])) {
$REQUIRE_LIB['bootstrap5'] = '';
}