From 8f5d084383740f0848c4e181bde90a2aa238d9d1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 24 Mar 2013 22:04:25 +0000 Subject: MS_NETLIB_URLENCODE removed from all plugins, but still exists in the core git-svn-id: http://svn.miranda-ng.org/main/trunk@4181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CrashDumper/src/upload.cpp | 14 ++++---------- plugins/Scriver/src/utils.cpp | 7 ++----- plugins/Weather/src/weather_addstn.cpp | 11 +++-------- 3 files changed, 9 insertions(+), 23 deletions(-) (limited to 'plugins') diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index a8e4f2dee5..7b50d9f866 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -72,19 +72,13 @@ void OpenAuthUrl(const char* url) char user[64], pass[40]; GetLoginStr(user, sizeof(user), pass); - if (user[0] && pass[0]) - { + if (user[0] && pass[0]) { char str[256]; - mir_snprintf(str, sizeof(str), url, user); - char* eurl = (char*)CallService(MS_NETLIB_URLENCODE, 0, (LPARAM)str); - - mir_snprintf(str, sizeof(str), "http://www.miranda-vi.org/cdlogin?name=%s&pass=%s&redir=%s", user, pass, eurl); - CallService(MS_UTILS_OPENURL, 1, (LPARAM)str); - HeapFree(GetProcessHeap(), 0, eurl); + mir_snprintf(str, sizeof(str), "http://www.miranda-vi.org/cdlogin?name=%s&pass=%s&redir=%s", user, pass, mir_ptr( mir_urlEncode(str))); + CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)str); } - else - CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://www.miranda-vi.org/"); + else CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)"http://www.miranda-vi.org/"); } void CreateAuthString(char* auth) diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 46bbc41530..1963baafd9 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -431,9 +431,8 @@ void SearchWord(TCHAR * word, int engine) { char szURL[4096]; if (word && word[0]) { - char *wordUTF = mir_utf8encodeT(word); - //char *wordURL = (char *)CallService(MS_NETLIB_URLENCODE, 0, (LPARAM)wordUTF); - char *wordURL = url_encode(wordUTF); + mir_ptr wordUTF( mir_utf8encodeT(word)); + mir_ptr wordURL( mir_urlEncode(wordUTF)); switch (engine) { case SEARCHENGINE_WIKIPEDIA: mir_snprintf(szURL, SIZEOF(szURL), "http://en.wikipedia.org/wiki/%s", wordURL); @@ -462,8 +461,6 @@ void SearchWord(TCHAR * word, int engine) break; } - mir_free(wordUTF); - mir_free(wordURL); CallService(MS_UTILS_OPENURL, 1, (LPARAM) szURL); } } diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index 22cf2b5ddc..fe315a8ad5 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -306,17 +306,12 @@ int IDSearch(TCHAR *sID, const int searchId) // svcname = the name of the weather service that is currently searching (ie. Yahoo Weather) int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *svc, TCHAR *svcname) { - char loc[256]; TCHAR Name[MAX_DATA_LEN], str[MAX_DATA_LEN], sID[MAX_DATA_LEN], *szData = NULL, *search; // replace spaces with %20 - { - mir_ptr szSearchName( mir_utf8encodeT(name)); - char *pstr = (char*)CallService(MS_NETLIB_URLENCODE, 0, (LPARAM)(char*)szSearchName); - wsprintfA(loc, sData->SearchURL, pstr); - HeapFree(GetProcessHeap(), 0, pstr); - } - + char loc[256]; + mir_ptr szSearchName( mir_utf8encodeT(name)); + wsprintfA(loc, sData->SearchURL, mir_ptr( mir_urlEncode(szSearchName))); if (InternetDownloadFile(loc, NULL, &szData) == 0) { TCHAR* szInfo = szData; search = _tcsstr(szInfo, sData->NotFoundStr); // determine if data is available -- cgit v1.2.3