Make it possible to search for punishments by ID

This commit is contained in:
ruan 2016-11-14 08:59:21 +02:00
parent fea240ef03
commit 87953d86f8
No known key found for this signature in database
GPG Key ID: 062534EE618F498C
2 changed files with 17 additions and 7 deletions

View File

@ -20,21 +20,29 @@ class Check {
}
}
$stmt->closeCursor();
// sanitize $_POST['table'] ($from)
$from_type = $page->type_info($from);
$type = $from_type['type'];
if (!isset($uuid)) {
if (filter_var($name, FILTER_VALIDATE_FLOAT)) {
echo "<br>";
$page->settings->redirect("info.php?id=$name&type=$type", false);
return;
}
$name = htmlspecialchars($name, ENT_QUOTES, 'UTF-8');
$this->println("$name " . $page->lang->check_notjoin);
return;
}
$href = "history.php?uuid=$uuid";
// sanitize $_POST['table'] ($from)
$from_type = $page->type_info($from);
$type = $from_type['type'];
if ($type !== null) {
$href .= "&from=" . Page::lc_first($from_type['title']);
}
echo "<br><script data-cfasync=\"false\" type=\"text/javascript\">document.location.href=\"$href\";</script>";
echo "<br>";
$page->settings->redirect($href, false);
/*
$table = $page->settings->table['bans'];

View File

@ -211,9 +211,11 @@ final class Settings {
}
function redirect($url) {
function redirect($url, $showtext = true) {
if ($showtext === true) {
echo "<a href=\"$url\">Redirecting...</a>";
echo "<script type=\"text/javascript\">document.location=\"$url\";</script>";
}
echo "<script data-cfasync=\"false\" type=\"text/javascript\">document.location=\"$url\";</script>";
die;
}
}