|
@@ -37,6 +37,8 @@ import java.net.URL;
|
37
|
37
|
import java.util.ArrayList;
|
38
|
38
|
import java.util.Date;
|
39
|
39
|
import java.util.List;
|
|
40
|
+import java.util.regex.Matcher;
|
|
41
|
+import java.util.regex.Pattern;
|
40
|
42
|
|
41
|
43
|
/** Handles URLs. */
|
42
|
44
|
public class URLHandler {
|
|
@@ -206,15 +208,15 @@ public class URLHandler {
|
206
|
208
|
}
|
207
|
209
|
}
|
208
|
210
|
|
209
|
|
- newCommand = newCommand.replaceAll("\\$url", url.toString());
|
210
|
|
- newCommand = newCommand.replaceAll("\\$fragment", fragment);
|
211
|
|
- newCommand = newCommand.replaceAll("\\$host", host);
|
212
|
|
- newCommand = newCommand.replaceAll("\\$path", path);
|
213
|
|
- newCommand = newCommand.replaceAll("\\$port", port);
|
214
|
|
- newCommand = newCommand.replaceAll("\\$query", query);
|
215
|
|
- newCommand = newCommand.replaceAll("\\$protocol", protocol);
|
216
|
|
- newCommand = newCommand.replaceAll("\\$username", username);
|
217
|
|
- newCommand = newCommand.replaceAll("\\$password", password);
|
|
211
|
+ newCommand = newCommand.replaceAll("\\$url", Matcher.quoteReplacement(url.toString()));
|
|
212
|
+ newCommand = newCommand.replaceAll("\\$fragment", Matcher.quoteReplacement(fragment));
|
|
213
|
+ newCommand = newCommand.replaceAll("\\$host", Matcher.quoteReplacement(host));
|
|
214
|
+ newCommand = newCommand.replaceAll("\\$path", Matcher.quoteReplacement(path));
|
|
215
|
+ newCommand = newCommand.replaceAll("\\$port", Matcher.quoteReplacement(port));
|
|
216
|
+ newCommand = newCommand.replaceAll("\\$query", Matcher.quoteReplacement(query));
|
|
217
|
+ newCommand = newCommand.replaceAll("\\$protocol", Matcher.quoteReplacement(protocol));
|
|
218
|
+ newCommand = newCommand.replaceAll("\\$username", Matcher.quoteReplacement(username));
|
|
219
|
+ newCommand = newCommand.replaceAll("\\$password", Matcher.quoteReplacement(password));
|
218
|
220
|
|
219
|
221
|
return newCommand;
|
220
|
222
|
}
|