summaryrefslogtreecommitdiffstats
path: root/src/HTTP/HTTPFormParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/HTTP/HTTPFormParser.cpp13
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;
}
}