function refreshConsentToken2($offers_string, $refreshtoken, $ru = null) { $body = WindowsLiveLogin::fetch(WindowsLiveLogin::getRefreshConsentTokenUrl($offers_string, $refreshtoken, $ru)); if (!$body) { WindowsLiveLogin::debug("Error: refreshConsentToken2: Failed to obtain a new token."); return; } preg_match('/\\{"ConsentToken":"(.*)"\\}/', $body, $matches); if (count($matches) == 2) { return $matches[1]; } else { WindowsLiveLogin::debug("Error: refreshConsentToken2: Failed to extract token: {$body}"); return; } }