1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-01 10:52:18 +01:00

Refactor.

This commit is contained in:
Jean Paul Galea 2015-07-21 21:38:37 +00:00
parent 3572410b30
commit ca5e787452

View File

@ -53,16 +53,25 @@ function logdie ($logger, $str)
die($str . "\n"); die($str . "\n");
} }
function getHttpVal($key, $defaultVal) { function getHttpVal ($key, $default)
$val = $defaultVal; {
if (array_key_exists($key, $_GET)) { if (array_key_exists($key, $_GET))
{
$val = $_GET[$key]; $val = $_GET[$key];
} else if (array_key_exists($key, $_POST)) { }
$val = $_POST[$key]; elseif (array_key_exists($key, $_POST))
} {
$v = trim($val); $val = $_POST[$key];
$v = str_replace('\\', "", $v); }
return $v; else
{
$val = $default;
}
$val = trim($val);
$val = str_replace('\\', '', $val);
return $val;
} }
function log_format() { function log_format() {