summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-24 13:59:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-24 13:59:13 +0300
commit972fa306badc2e072d65cec43c37496aa952eee0 (patch)
tree76ff03a4b30ba245206fde8c7ee726b957807207 /src
parent1b60fdaf9e55690bbfb5a6d8b3f6b970e6d4373f (diff)
mir_urlDecode restored
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mir_core/src/http.cpp24
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
3 files changed, 26 insertions, 0 deletions
diff --git a/src/mir_core/src/http.cpp b/src/mir_core/src/http.cpp
index fad969c680..8d4ae7dfd6 100755
--- a/src/mir_core/src/http.cpp
+++ b/src/mir_core/src/http.cpp
@@ -21,6 +21,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static const char szHexDigits[] = "0123456789ABCDEF";
+MIR_CORE_DLL(char*) mir_urlDecode(const char *szUrl)
+{
+ if (szUrl == nullptr)
+ return nullptr;
+
+ char *ret = mir_strdup(szUrl);
+
+ for (char *p = ret; *p; p++) {
+ switch (*p) {
+ case '%':
+ int ii;
+ sscanf(p+1, "%2x", &ii);
+ strdel(p, 2);
+ *p = ii;
+ break;
+
+ case '+':
+ *p = ' ';
+ break;
+ }
+ }
+ return ret;
+}
+
MIR_CORE_DLL(char*) mir_urlEncode(const char *szUrl)
{
if (szUrl == nullptr)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 4a744c5b5f..2626bbf556 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -154,6 +154,7 @@ wildcmpi @158
wildcmpiw @159
mir_base64_encode @160
mir_base64_decode @161
+mir_urlDecode @162
db_set_resident @165
db_set @166
mir_subclassWindowFull @218
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 3f25e54f77..6a5981c157 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -154,6 +154,7 @@ wildcmpi @158
wildcmpiw @159
mir_base64_encode @160
mir_base64_decode @161
+mir_urlDecode @162
db_set_resident @165
db_set @166
mir_subclassWindowFull @218