1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 23:27:17 +02:00

Move $token to get_token()

This commit is contained in:
Jakub Vrana
2025-03-28 18:49:26 +01:00
parent 74457f0895
commit e219ef9ad1
7 changed files with 10 additions and 13 deletions

View File

@@ -24,13 +24,11 @@ function input_hidden(string $name, $value = ""): string {
return "<input type='hidden' name='" . h($name) . "' value='" . h($value) . "'>\n";
}
/** Get <input type="hidden" name="token">
* @param string $special token to use instead of global $token
/** Get CSRF <input type="hidden" name="token">
* @return string HTML
*/
function input_token(string $special = ""): string {
global $token;
return input_hidden("token", ($special ?: $token));
function input_token(): string {
return input_hidden("token", get_token());
}
/** Get a target="_blank" attribute */