diff --git a/ykval-verify.php b/ykval-verify.php index cfacbe6..55ce004 100644 --- a/ykval-verify.php +++ b/ykval-verify.php @@ -150,6 +150,11 @@ if (!isset($sl) || $sl == '') { $sl = $baseParams['__YKVAL_SYNC_DEFAULT_LEVEL__']; } +if ($sl && (preg_match("/^[0-9]+$/", $sl)==0 || ($sl<0 || $sl>100))) +{ + $myLog->log(LOG_NOTICE, 'SL is provided but not correct'); + sendResp(S_MISSING_PARAMETER, $myLog); +} if (!isset($timeout) || $timeout == '') { @@ -200,12 +205,6 @@ if (isset($nonce) && (strlen($nonce) < 16 || strlen($nonce) > 40)) sendResp(S_MISSING_PARAMETER, $myLog); } -if ($sl && (preg_match("/^[0-9]+$/", $sl)==0 || ($sl<0 || $sl>100))) -{ - $myLog->log(LOG_NOTICE, 'SL is provided but not correct'); - sendResp(S_MISSING_PARAMETER, $myLog); -} - /** * Timestamp parameter is not checked since current protocol * says that 1 means request timestamp and anything else is discarded.