summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-12-25 18:29:21 +0100
committerGitHub <noreply@github.com>2016-12-25 18:29:21 +0100
commitb3b723b4531a3781ab847a2652cf192303e78941 (patch)
treec7c3169575541c662438834973a5c7fc34188a70 /src/WebAdmin.cpp
parentUpdated links and docs (#3488) (diff)
downloadcuberite-b3b723b4531a3781ab847a2652cf192303e78941.tar
cuberite-b3b723b4531a3781ab847a2652cf192303e78941.tar.gz
cuberite-b3b723b4531a3781ab847a2652cf192303e78941.tar.bz2
cuberite-b3b723b4531a3781ab847a2652cf192303e78941.tar.lz
cuberite-b3b723b4531a3781ab847a2652cf192303e78941.tar.xz
cuberite-b3b723b4531a3781ab847a2652cf192303e78941.tar.zst
cuberite-b3b723b4531a3781ab847a2652cf192303e78941.zip
Diffstat (limited to 'src/WebAdmin.cpp')
-rw-r--r--src/WebAdmin.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp
index 5c08deb0d..1e60b7c0e 100644
--- a/src/WebAdmin.cpp
+++ b/src/WebAdmin.cpp
@@ -602,30 +602,7 @@ AString cWebAdmin::GetHTMLEscapedString(const AString & a_Input)
AString cWebAdmin::GetURLEncodedString(const AString & a_Input)
{
- // Translation table from nibble to hex:
- static const char Hex[] = "0123456789abcdef";
-
- // Preallocate the output to match input:
- AString dst;
- size_t len = a_Input.length();
- dst.reserve(len);
-
- // Loop over input and substitute whatever is needed:
- for (size_t i = 0; i < len; i++)
- {
- char ch = a_Input[i];
- if (isalnum(ch) || (ch == '-') || (ch == '_') || (ch == '.') || (ch == '~'))
- {
- dst.push_back(ch);
- }
- else
- {
- dst.push_back('%');
- dst.push_back(Hex[(ch >> 4) & 0x0f]);
- dst.push_back(Hex[ch & 0x0f]);
- }
- } // for i - a_Input[]
- return dst;
+ return URLEncode(a_Input);
}