From 36857f0695a39070d10ebc5b68f0d54560e07039 Mon Sep 17 00:00:00 2001 From: NightFox <0x4E69676874466F78@users.noreply.github.com> Date: Fri, 12 Jul 2019 00:01:36 +0300 Subject: Improvement logic regular expressions for skype_oauth.cpp Immunity to extraneous classes, attributes, spaces But the best way is to use a good html parser --- protocols/SkypeWeb/src/skype_oauth.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp index 290a70fe83..85327edf91 100644 --- a/protocols/SkypeWeb/src/skype_oauth.cpp +++ b/protocols/SkypeWeb/src/skype_oauth.cpp @@ -30,7 +30,7 @@ void CSkypeProto::OnOAuthStart(const NETLIBHTTPREQUEST *response) std::map scookies; std::string content = response->pData; - regex = ""; + regex = ""; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); @@ -66,8 +66,8 @@ void CSkypeProto::OnOAuthAuthorize(const NETLIBHTTPREQUEST *response) std::string content = response->pData; std::smatch match; - if (!std::regex_search(content, match, std::regex(""))) { - if (!std::regex_search(content, match, std::regex(""))) { + if (!std::regex_search(content, match, std::regex(""))) { + if (!std::regex_search(content, match, std::regex(""))) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); SetStatus(ID_STATUS_OFFLINE); return; @@ -90,7 +90,7 @@ void CSkypeProto::OnOAuthEnd(const NETLIBHTTPREQUEST *response) std::smatch match; std::string content = response->pData; - regex = ""; + regex = ""; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); SetStatus(ID_STATUS_OFFLINE); @@ -98,7 +98,7 @@ void CSkypeProto::OnOAuthEnd(const NETLIBHTTPREQUEST *response) } std::string token = match[1]; setString("TokenSecret", token.c_str()); - regex = ""; + regex = ""; if (std::regex_search(content, match, regex)) { std::string expiresIn = match[1]; -- cgit v1.2.3