1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-01 01: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");
}
function getHttpVal($key, $defaultVal) {
$val = $defaultVal;
if (array_key_exists($key, $_GET)) {
function getHttpVal ($key, $default)
{
if (array_key_exists($key, $_GET))
{
$val = $_GET[$key];
} else if (array_key_exists($key, $_POST)) {
}
elseif (array_key_exists($key, $_POST))
{
$val = $_POST[$key];
}
$v = trim($val);
$v = str_replace('\\', "", $v);
return $v;
else
{
$val = $default;
}
$val = trim($val);
$val = str_replace('\\', '', $val);
return $val;
}
function log_format() {