mirror of
https://github.com/Yubico/yubikey-ksm.git
synced 2025-01-19 07:52:17 +01:00
First test for parameter, then use it
One should test if a parameter exists before using it instead of letting the PHP auto-type conversion magic have its way with it.
This commit is contained in:
parent
cc6b292fe0
commit
fff4394ca7
@ -34,11 +34,11 @@ require_once 'ykksm-utils.php';
|
||||
openlog("ykksm", LOG_PID, $logfacility)
|
||||
or die("ERR Syslog open error\n");
|
||||
|
||||
$otp = $_REQUEST["otp"];
|
||||
if (!$otp) {
|
||||
if (!isset($_REQUEST["otp"])) {
|
||||
syslog(LOG_INFO, "No OTP provided");
|
||||
die("ERR No OTP provided\n");
|
||||
die("ERR Invalid OTP format\n");
|
||||
}
|
||||
$otp = $_REQUEST["otp"];
|
||||
|
||||
if (!preg_match("/^([cbdefghijklnrtuv]{0,16})([cbdefghijklnrtuv]{32})$/",
|
||||
$otp, $matches)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user