]> git.mxchange.org Git - flightgear.git/commitdiff
Patches from Melchior Franz:
authordavid <david>
Wed, 6 Feb 2002 14:21:24 +0000 (14:21 +0000)
committerdavid <david>
Wed, 6 Feb 2002 14:21:24 +0000 (14:21 +0000)
  - fix html bug (<form> was closed by another <form>, instead of </form>)
  - remove useless <br>
  - fix a bug, that would have truncated an argument containing a '&'
  - extend the comment for urlEncode: cite the concerned RFC

src/Network/httpd.cxx

index bacb67179f7de41d444b884e7a026af5b5b5d058..5cc4219262bb69ab99500da86d0c3cfe71e02550 100644 (file)
@@ -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 += "<input type=submit value=\"update\" name=\"submit\">";
-            response += "<FORM>";
-            response += "<BR>";
+            response += "</FORM>";
         }
         response += "</BODY>";
         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 = "";