]> git.mxchange.org Git - flightgear.git/commitdiff
PropertyChangeWebsocket: sanitize property names
authorTorsten Dreyer <torsten@ŧ3r.de>
Tue, 17 Mar 2015 08:27:03 +0000 (09:27 +0100)
committerTorsten Dreyer <torsten@ŧ3r.de>
Tue, 17 Mar 2015 08:27:03 +0000 (09:27 +0100)
src/Network/http/PropertyChangeWebsocket.cxx

index 0d08fc3675abeb3447879334a3adc0a9bb962e17..c1c23b516f9645db2f7a68d5fce0bb98f9a00947 100644 (file)
@@ -174,7 +174,7 @@ void PropertyChangeWebsocket::handleRequest(const HTTPRequest & request, Websock
     string_list nodeNames;
     j = cJSON_GetObjectItem(json, "node");
     if ( NULL != j && NULL != j->valuestring) {
-      nodeNames.push_back(j->valuestring);
+        nodeNames.push_back(simgear::strutils::strip(string(j->valuestring)));
     }
 
     cJSON * nodes = cJSON_GetObjectItem(json, "nodes");
@@ -183,7 +183,7 @@ void PropertyChangeWebsocket::handleRequest(const HTTPRequest & request, Websock
         cJSON * node = cJSON_GetArrayItem(nodes, i);
         if ( NULL == node) continue;
         if ( NULL == node->valuestring) continue;
-        nodeNames.push_back(node->valuestring);
+        nodeNames.push_back(simgear::strutils::strip(string(node->valuestring)));
       }
     }