Fix redirection on non-English locales

This commit is contained in:
ruan 2020-02-12 07:03:07 +02:00
parent f8318961ed
commit 355a40727d
3 changed files with 9 additions and 4 deletions

View File

@ -29,8 +29,8 @@ class Check {
$stmt->closeCursor();
// sanitize $_POST['table'] ($from)
$from_type = $page->type_info($from);
$type = $from_type['type'];
$info = $page->type_info($from);
$type = $info['type'];
if (!isset($uuid)) {
if (filter_var($name, FILTER_VALIDATE_FLOAT)) {
@ -46,7 +46,7 @@ class Check {
$href = "history.php?uuid=$uuid";
if ($type !== null) {
$href .= "&from=" . Page::lc_first($from_type['title']);
$href .= "&from=$type";
}
echo "<br>";

View File

@ -99,7 +99,7 @@ if (isset($_GET['from'])) {
if ($info['type'] !== null) {
$from_title = $info['title'];
$from = Page::lc_first($from_title);
$from_href = "$from.php";
$from_href = $info['page'];
}
}

View File

@ -95,6 +95,7 @@ class Page {
"type" => "ban",
"table" => $settings->table['bans'],
"title" => $this->t("title.bans"),
"page" => "bans.php",
);
case "mute":
case "mutes":
@ -102,6 +103,7 @@ class Page {
"type" => "mute",
"table" => $settings->table['mutes'],
"title" => $this->t("title.mutes"),
"page" => "mutes.php",
);
case "warn":
case "warnings":
@ -109,6 +111,7 @@ class Page {
"type" => "warn",
"table" => $settings->table['warnings'],
"title" => $this->t("title.warnings"),
"page" => "warnings.php",
);
case "kick":
case "kicks":
@ -116,12 +119,14 @@ class Page {
"type" => "kick",
"table" => $settings->table['kicks'],
"title" => $this->t("title.kicks"),
"page" => "kicks.php",
);
default:
return array(
"type" => null,
"table" => null,
"title" => null,
"page" => null,
);
}
}