|
20 | 20 | */ |
21 | 21 |
|
22 | 22 | #include "ParseClient.h" |
| 23 | +#include "ParseUtils.h" |
23 | 24 |
|
24 | 25 | ParseClient::ParseClient() { |
25 | 26 | } |
@@ -95,20 +96,25 @@ ParseResponse ParseClient::sendRequest(const char* httpVerb, const char* httpPat |
95 | 96 | ParseResponse ParseClient::sendRequest(const String& httpVerb, const String& httpPath, const String& requestBody, const String& urlParams) { |
96 | 97 | requestClient.begin("parse_request"); // start a process that launch the "parse_request" command |
97 | 98 |
|
98 | | - requestClient.addParameter("-v"); |
99 | | - requestClient.addParameter(httpVerb); |
100 | | - requestClient.addParameter("-e"); |
101 | | - requestClient.addParameter(httpPath); |
102 | | - if (requestBody != "") { |
103 | | - requestClient.addParameter("-d"); |
104 | | - requestClient.addParameter(requestBody); |
105 | | - } |
106 | | - if (urlParams != "") { |
107 | | - requestClient.addParameter("-p"); |
108 | | - requestClient.addParameter(urlParams); |
109 | | - requestClient.runAsynchronously(); |
110 | | - } else { |
111 | | - requestClient.run(); // Run the process and wait for its termination |
| 99 | + if( ParseUtils::isSanitizedString(httpVerb) |
| 100 | + && ParseUtils::isSanitizedString(httpPath) |
| 101 | + && ParseUtils::isSanitizedString(requestBody) |
| 102 | + && ParseUtils::isSanitizedString(urlParams)) { |
| 103 | + requestClient.addParameter("-v"); |
| 104 | + requestClient.addParameter(httpVerb); |
| 105 | + requestClient.addParameter("-e"); |
| 106 | + requestClient.addParameter(httpPath); |
| 107 | + if (requestBody != "") { |
| 108 | + requestClient.addParameter("-d"); |
| 109 | + requestClient.addParameter(requestBody); |
| 110 | + } |
| 111 | + if (urlParams != "") { |
| 112 | + requestClient.addParameter("-p"); |
| 113 | + requestClient.addParameter(urlParams); |
| 114 | + requestClient.runAsynchronously(); |
| 115 | + } else { |
| 116 | + requestClient.run(); // Run the process and wait for its termination |
| 117 | + } |
112 | 118 | } |
113 | 119 |
|
114 | 120 | ParseResponse response(&requestClient); |
|
0 commit comments