From e787987f54733bd58f69ced43a506aa7fc42fb7c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 28 Jan 2019 14:52:14 +0300 Subject: fixes #1797 (ICQ10: only images can be transferred) --- protocols/ICQ-WIM/src/proto.cpp | 2 +- src/mir_core/src/http.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 6628c10a80..bebceafef8 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -377,7 +377,7 @@ HANDLE CIcqProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFile pwszFileName = ppszFiles[0]; auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, "https://files.icq.com/files/init", &CIcqProto::OnFileInit); - pReq << CHAR_PARAM("a", m_szAToken) << CHAR_PARAM("client", "icq") << CHAR_PARAM("f", "json") << WCHAR_PARAM("fileName", pwszFileName) + pReq << CHAR_PARAM("a", m_szAToken) << CHAR_PARAM("client", "icq") << CHAR_PARAM("f", "json") << CHAR_PARAM("fileName", ptrA(mir_urlEncode(T2Utf(pwszFileName)))) << CHAR_PARAM("k", ICQ_APP_ID) << INT_PARAM("size", statbuf.st_size) << INT_PARAM("ts", time(0)); CalcHash(pReq); pReq->pUserInfo = pTransfer; diff --git a/src/mir_core/src/http.cpp b/src/mir_core/src/http.cpp index 5539eef58c..d1386e4519 100755 --- a/src/mir_core/src/http.cpp +++ b/src/mir_core/src/http.cpp @@ -53,8 +53,7 @@ MIR_CORE_DLL(char*) mir_urlEncode(const char *szUrl) const BYTE *s; int outputLen; for (outputLen = 0, s = (const BYTE*)szUrl; *s; s++) { - if ((*s & 0x80) || - ('0' <= *s && *s <= '9') || //0-9 + if (('0' <= *s && *s <= '9') || //0-9 ('A' <= *s && *s <= 'Z') || //ABC...XYZ ('a' <= *s && *s <= 'z') || //abc...xyz *s == '-' || *s == '_' || *s == '.' || *s == ' ' || *s == '~') @@ -69,8 +68,7 @@ MIR_CORE_DLL(char*) mir_urlEncode(const char *szUrl) char *d = szOutput; for (s = (const BYTE*)szUrl; *s; s++) { - if ((*s & 0x80) || - ('0' <= *s && *s <= '9') || //0-9 + if (('0' <= *s && *s <= '9') || //0-9 ('A' <= *s && *s <= 'Z') || //ABC...XYZ ('a' <= *s && *s <= 'z') || //abc...xyz *s == '-' || *s == '_' || *s == '.' || *s == '~') -- cgit v1.2.3