diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-07 12:53:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-07 12:53:15 +0300 |
commit | a9fbe9a81a6777b4b358d93116ee15f9f07dfb6e (patch) | |
tree | 6d1b3e0d21bad29bf0c20cd35b9ec1b814124e7a /plugins/SmileyAdd/src | |
parent | d644d959712596bb4a54353da1003212bac4091b (diff) |
custom UrlDecode removed
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r-- | plugins/SmileyAdd/src/customsmiley.cpp | 8 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/general.cpp | 34 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/stdafx.h | 2 |
3 files changed, 3 insertions, 41 deletions
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index 686560a9d0..624b016a7c 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -67,13 +67,11 @@ SmileyCType::SmileyCType(const CMStringW &fullpath, const wchar_t *filepath) bool SmileyCType::CreateTriggerText(char *text)
{
- UrlDecode(text);
-
- int len = (int)mir_strlen(text);
- if (len == 0) return false;
+ if (mir_strlen(text) == 0)
+ return false;
size_t reslen;
- ptrA res((char*)mir_base64_decode(text, &reslen));
+ ptrA res((char*)mir_base64_decode(mir_urlDecode(text), &reslen));
if (res == NULL)
return false;
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index af943b4c4e..06547da24a 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -148,40 +148,6 @@ void pathToAbsolute(const CMStringW &pSrc, CMStringW &pOut) pOut = szOutPath;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// UrlDecode - converts URL chars like %20 into printable characters
-
-static int __fastcall SingleHexToDecimal(char c)
-{
- if (c >= '0' && c <= '9') return c - '0';
- if (c >= 'a' && c <= 'f') return c - 'a' + 10;
- if (c >= 'A' && c <= 'F') return c - 'A' + 10;
- return -1;
-}
-
-void UrlDecode(char *str)
-{
- char *s = str, *d = str;
-
- while (*s) {
- if (*s == '%') {
- int digit1 = SingleHexToDecimal(s[1]);
- if (digit1 != -1) {
- int digit2 = SingleHexToDecimal(s[2]);
- if (digit2 != -1) {
- s += 3;
- *d++ = (char)((digit1 << 4) | digit2);
- continue;
- }
- }
- }
- *d++ = *s++;
- }
-
- *d = 0;
-}
-
-
bool InitGdiPlus(void)
{
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index 6817dfcbc9..35949d1e36 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -148,6 +148,4 @@ void RichEditData_Destroy(void); void CloseSmileys(void);
int CheckForTip(int x, int y, HWND hwnd, wchar_t **smltxt);
-void UrlDecode(char *str);
-
#endif
|