Skip to content

Commit d91b6ae

Browse files
committed
Replays: Always check CSRF in the manager
1 parent 99ddb79 commit d91b6ae

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

replay.pokemonshowdown.com/replay-manage.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
$manage = false;
1818
$csrfOk = false;
1919

20-
if (isset($_REQUEST['manage'])) {
21-
require_once '../lib/ntbb-session.lib.php';
22-
if (!$users->isLeader()) die("access denied");
23-
$csrfOk = !!$users->csrfCheck();
24-
$manage = true;
25-
header('Cache-Control: max-age=0, no-cache, no-store, must-revalidate');
26-
}
20+
// this no longer needs to be in an if block, since the only reason to access
21+
// this at /manage is for managing. just assume they're always doing that
22+
require_once '../lib/ntbb-session.lib.php';
23+
if (!$users->isLeader()) die("access denied");
24+
$csrfOk = !!$users->csrfCheck();
25+
$manage = true;
26+
header('Cache-Control: max-age=0, no-cache, no-store, must-revalidate');
2727

2828
if (preg_match('/[^A-Za-z0-9-]/', $id)) die("access denied");
2929

0 commit comments

Comments
 (0)