Escaped a dot in the regex used to validate onion hostnames.

This commit is contained in:
akwizgran
2013-05-16 15:44:56 +01:00
parent 37e68d5e9e
commit c3e9ada0d9

View File

@@ -56,7 +56,8 @@ class TorPlugin implements DuplexPlugin, EventHandler {
private static final int SOCKS_PORT = 59050, CONTROL_PORT = 59051;
private static final int COOKIE_TIMEOUT = 3000; // Milliseconds
private static final int HOSTNAME_TIMEOUT = 30 * 1000; // Milliseconds
private static final Pattern ONION = Pattern.compile("[a-z2-7]{16}.onion");
private static final Pattern ONION =
Pattern.compile("[a-z2-7]{16}\\.onion");
private static final Logger LOG =
Logger.getLogger(TorPlugin.class.getName());