mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Use undashed UUIDs for URL parameters
This commit is contained in:
parent
7e4d5de57a
commit
ef84e6f782
@ -42,6 +42,7 @@ class Check {
|
|||||||
$this->println(str_replace("{name}", $name, $page->t("error.name.unseen")));
|
$this->println(str_replace("{name}", $name, $page->t("error.name.unseen")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$uuid = $page->uuid_undashify($uuid);
|
||||||
$href = "history.php?uuid=$uuid";
|
$href = "history.php?uuid=$uuid";
|
||||||
|
|
||||||
if ($type !== null) {
|
if ($type !== null) {
|
||||||
|
@ -75,7 +75,7 @@ isset($_GET['uuid']) && is_string($_GET['uuid']) or die($page->t("error.missing-
|
|||||||
|
|
||||||
$staffhistory = (isset($_GET['staffhistory']) && $_GET['staffhistory'] === "1");
|
$staffhistory = (isset($_GET['staffhistory']) && $_GET['staffhistory'] === "1");
|
||||||
|
|
||||||
$uuid = $_GET['uuid'];
|
$uuid = $page->uuid_dashify($_GET['uuid']);
|
||||||
$name = $page->get_name($uuid);
|
$name = $page->get_name($uuid);
|
||||||
|
|
||||||
$name !== null or die(str_replace("{name}", $name, $page->t("error.name.unseen")));
|
$name !== null or die(str_replace("{name}", $name, $page->t("error.name.unseen")));
|
||||||
|
@ -214,7 +214,7 @@ class Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$uuid = str_replace("-", "", $uuid);
|
$uuid = $this->uuid_undashify($uuid);
|
||||||
$src = str_replace('{name}', $name, str_replace('{uuid}', $uuid, $avatar_source));
|
$src = str_replace('{name}', $name, str_replace('{uuid}', $uuid, $avatar_source));
|
||||||
if (in_array($name, $this->settings->console_aliases) || $name === $this->settings->console_name) {
|
if (in_array($name, $this->settings->console_aliases) || $name === $this->settings->console_name) {
|
||||||
$src = $this->settings->console_image;
|
$src = $this->settings->console_image;
|
||||||
@ -430,6 +430,11 @@ class Page {
|
|||||||
return $newstr;
|
return $newstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uuid_undashify($str) {
|
||||||
|
if (strlen($str) !== 36) return $str;
|
||||||
|
return str_replace('-', '', $str);
|
||||||
|
}
|
||||||
|
|
||||||
function print_title() {
|
function print_title() {
|
||||||
$title = $this->title;
|
$title = $this->title;
|
||||||
$name = $this->settings->name;
|
$name = $this->settings->name;
|
||||||
|
1
info.php
1
info.php
@ -39,6 +39,7 @@ abstract class Info {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function history_link($player_name, $uuid, $args = "") {
|
function history_link($player_name, $uuid, $args = "") {
|
||||||
|
$uuid = $this->page->uuid_undashify($uuid);
|
||||||
return "<a href=\"history.php?uuid=$uuid$args\">$player_name</a>";
|
return "<a href=\"history.php?uuid=$uuid$args\">$player_name</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user