diff options
author | George Hazan <ghazan@miranda.im> | 2017-06-14 13:23:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-06-14 13:23:29 +0300 |
commit | 0624450987119c11594e59158cde800391b42db4 (patch) | |
tree | 6a6fb44150fc5f31446a87b260d9812b103afa58 | |
parent | ff728bba88080d5cd2b272bfe2792b5651e222fe (diff) |
Skype: more correct version of auth fix
-rw-r--r-- | protocols/SkypeWeb/src/skype_oauth.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp index ae7c1b305b..958549acd8 100644 --- a/protocols/SkypeWeb/src/skype_oauth.cpp +++ b/protocols/SkypeWeb/src/skype_oauth.cpp @@ -64,16 +64,14 @@ void CSkypeProto::OnOAuthAuthorize(const NETLIBHTTPREQUEST *response) return; } - std::regex regex, regex2; - std::smatch match; std::string content = response->pData; - - regex = "<input type=\"hidden\" name=\"t\" id=\"t\" value=\"(.+?)\">"; - regex2 = "<input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"(.+?)\">"; - if (!(std::regex_search(content, match, regex) || std::regex_search(content, match, regex2))) { - ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); - SetStatus(ID_STATUS_OFFLINE); - return; + std::smatch match; + if (!std::regex_search(content, match, std::regex("<input type=\"hidden\" name=\"t\" id=\"t\" value=\"(.+?)\">"))) { + if (!std::regex_search(content, match, std::regex("<input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"(.+?)\">"))) { + ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); + SetStatus(ID_STATUS_OFFLINE); + return; + } } std::string t = match[1]; |