mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
The alliance/editAli/delAli pages are linked all over the admin panel (?p=alliance&aid=, ?p=editAli, ?p=delAli) but were never in admin_validated_page()'s whitelist, so admin.php fell back to search.tpl and the pages never showed. Add them to the whitelist plus switch cases for the breadcrumb (the templates resolve $aid/$alidata themselves from $_GET, like editSitter/editPassword). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,7 @@ function admin_validated_page(string $raw): string
|
||||
'editWeek', 'userlogin', 'userillegallog', 'editHero', 'editAdditional',
|
||||
'village', 'editResources', 'addTroops', 'addABTroops', 'editVillage',
|
||||
'villagelog', 'techlog', 'msg',
|
||||
'alliance', 'editAli', 'delAli',
|
||||
];
|
||||
|
||||
return in_array($raw, $whitelist, true) ? $raw : '';
|
||||
@@ -503,6 +504,37 @@ if ($page !== '') {
|
||||
}
|
||||
break;
|
||||
|
||||
// ── Alliance-context pages (require a valid ?aid=) ───────────────────
|
||||
case 'alliance':
|
||||
$aid = admin_input_id($_GET, 'aid');
|
||||
if ($aid !== null) {
|
||||
$alidata = $database->getAlliance($aid);
|
||||
$subpage = $alidata ? 'Alliance (' . e($alidata['tag']) . ')' : 'Alliance (ID ' . $aid . ' not found)';
|
||||
} else {
|
||||
$subpage = 'Alliance';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'editAli':
|
||||
$aid = admin_input_id($_GET, 'aid');
|
||||
if ($aid !== null) {
|
||||
$alidata = $database->getAlliance($aid);
|
||||
$subpage = $alidata ? 'Edit Alliance (' . e($alidata['tag']) . ')' : 'Edit Alliance';
|
||||
} else {
|
||||
$subpage = 'Edit Alliance';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delAli':
|
||||
$aid = admin_input_id($_GET, 'aid');
|
||||
if ($aid !== null) {
|
||||
$alidata = $database->getAlliance($aid);
|
||||
$subpage = $alidata ? 'Delete Alliance (' . e($alidata['tag']) . ')' : 'Delete Alliance';
|
||||
} else {
|
||||
$subpage = 'Delete Alliance';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'villagelog':
|
||||
$did = admin_input_id($_GET, 'did');
|
||||
if ($did !== null) {
|
||||
|
||||
Reference in New Issue
Block a user