# HG changeset patch # User Dan Fuhry # Date 1460150596 14400 # Node ID 351d40b21cbc2b584703d5d88aa8001fb52f94e4 # Parent d58bafde2a9278b779d2a7765b769d42c490aadb Cursory wsapi v2.0 support (backwards compatible) diff -r d58bafde2a92 -r 351d40b21cbc yms/validate-functions.php --- 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); diff -r d58bafde2a92 -r 351d40b21cbc yms/validate.php --- 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'])); }