diff options
author | Mattes D <github@xoft.cz> | 2016-12-25 18:29:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-25 18:29:21 +0100 |
commit | b3b723b4531a3781ab847a2652cf192303e78941 (patch) | |
tree | c7c3169575541c662438834973a5c7fc34188a70 /src/HTTP/HTTPFormParser.cpp | |
parent | Updated links and docs (#3488) (diff) | |
download | cuberite-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/HTTP/HTTPFormParser.cpp')
-rw-r--r-- | src/HTTP/HTTPFormParser.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/HTTP/HTTPFormParser.cpp b/src/HTTP/HTTPFormParser.cpp index ea5da3c18..6ad5d2592 100644 --- a/src/HTTP/HTTPFormParser.cpp +++ b/src/HTTP/HTTPFormParser.cpp @@ -167,13 +167,22 @@ void cHTTPFormParser::ParseFormUrlEncoded(void) case 1: { // Only name present - (*this)[URLDecode(ReplaceAllCharOccurrences(Components[0], '+', ' '))] = ""; + auto name = URLDecode(ReplaceAllCharOccurrences(Components[0], '+', ' ')); + if (name.first) + { + (*this)[name.second] = ""; + } break; } case 2: { // name=value format: - (*this)[URLDecode(ReplaceAllCharOccurrences(Components[0], '+', ' '))] = URLDecode(ReplaceAllCharOccurrences(Components[1], '+', ' ')); + auto name = URLDecode(Components[0]); + auto value = URLDecode(Components[1]); + if (name.first && value.first) + { + (*this)[name.second] = value.second; + } break; } } |