From: david Date: Wed, 6 Feb 2002 14:21:24 +0000 (+0000) Subject: Patches from Melchior Franz: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=670873198db4a2bf723641caaf90b04124e641fa;p=flightgear.git Patches from Melchior Franz: - fix html bug (
was closed by another , instead of
) - remove useless
- fix a bug, that would have truncated an argument containing a '&' - extend the comment for urlEncode: cite the concerned RFC --- diff --git a/src/Network/httpd.cxx b/src/Network/httpd.cxx index bacb67179..5cc421926 100644 --- a/src/Network/httpd.cxx +++ b/src/Network/httpd.cxx @@ -100,7 +100,6 @@ void HttpdChannel::foundTerminator (void) { unsigned int pos = rest.find( " " ); if ( pos != string::npos ) { request = rest.substr( 0, pos ); - request = urlDecode(request); } else { request = "/"; } @@ -112,6 +111,7 @@ void HttpdChannel::foundTerminator (void) { string args = request.substr( pos + 1 ); request = request.substr( 0, pos ); printf("'%s' '%s'\n", request.c_str(), args.c_str()); + request = urlDecode(request); // parse args looking for "value=" bool done = false; @@ -133,11 +133,13 @@ void HttpdChannel::foundTerminator (void) { string b = arg.substr( apos + 1 ); printf(" a = %s b = %s\n", a.c_str(), b.c_str() ); if ( a == "value" ) { - fgSetString( request, b ); + fgSetString( request, urlDecode(b) ); } } } - } + } else { + request = urlDecode(request); + } node = globals->get_props()->getNode(request); @@ -225,8 +227,7 @@ void HttpdChannel::foundTerminator (void) { response += value; response += "\" maxlength=2047>"; response += ""; - response += "
"; - response += "
"; + response += "
"; } response += ""; response += getTerminator(); @@ -257,7 +258,7 @@ void HttpdChannel::foundTerminator (void) { } -// encode everything but "a-zA-Z0-9_.-/" +// encode everything but "a-zA-Z0-9_.-/" (see RFC2396) string HttpdChannel::urlEncode(string s) { string r = "";