--- a/yms/validate-functions.php Fri Apr 08 17:22:15 2016 -0400
+++ b/yms/validate-functions.php Fri Apr 08 17:23:16 2016 -0400
@@ -27,6 +27,10 @@
$result = "h={$hash}\n";
foreach ( $response as $key => $value )
{
+ if ( $value === null )
+ {
+ continue;
+ }
$result .= "{$key}={$value}\n";
}
return trim($result);
--- a/yms/validate.php Fri Apr 08 17:22:15 2016 -0400
+++ b/yms/validate.php Fri Apr 08 17:23:16 2016 -0400
@@ -16,6 +16,12 @@
{
yms_send_reply('MISSING_PARAMETER', '', array('info' => 'otp'));
}
+
+ $nonce = null;
+ if ( isset($_GET['nonce']) )
+ {
+ $nonce = $_GET['nonce'];
+ }
// first, get API key so we can properly sign responses
$id = intval($_GET['id']);
@@ -42,6 +48,6 @@
$GLOBALS['g_api_key'] =& $g_api_key;
- yms_send_reply(yms_validate_otp($_GET['otp'], $id));
+ yms_send_reply(yms_validate_otp($_GET['otp'], $id), '', array('nonce' => $nonce, 'otp' => $_GET['otp']));
}