summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-06-14 13:23:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-06-14 13:23:29 +0300
commit0624450987119c11594e59158cde800391b42db4 (patch)
tree6a6fb44150fc5f31446a87b260d9812b103afa58 /protocols
parentff728bba88080d5cd2b272bfe2792b5651e222fe (diff)
Skype: more correct version of auth fix
Diffstat (limited to 'protocols')
-rw-r--r--protocols/SkypeWeb/src/skype_oauth.cpp16
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];