Support specifying prefixes in ladder/*.json requests (#1832)

This commit is contained in:
Mia
2021-07-04 17:51:38 -05:00
committed by GitHub
parent a0cfdd995f
commit 2d37d2353a

View File

@@ -52,7 +52,8 @@ if (isset($_REQUEST['json'])) {
header('Access-Control-Allow-Origin: *');
if (!$formatid) die('null');
$ladder = new NTBBLadder($formatid);
$toplist = $ladder->getTop();
$prefix = $_REQUEST['prefix'] ?? null;
$toplist = $ladder->getTop($prefix);
foreach ($toplist as &$row) {
unset($row['formatid']);
unset($row['entryid']);