]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/Domain.java
fixup! add: additional check for ip-addresses as domains
[gigi.git] / src / org / cacert / gigi / dbObjects / Domain.java
index e5d66a93f08f0ca5ea31638b0fd9951aae7122a5..55ed0f591f61a8769d85cd61cf6ad14aa116de71 100644 (file)
@@ -73,6 +73,12 @@ public class Domain implements IdCachable, Verifyable {
         if ( !s.equals(publicSuffix)) {
             throw new GigiApiException("You may only register a domain with exactly one lable before the public suffix.");
         }
+        if (("." + s).matches("(\\.[0-9]*)*")) {
+            // This is not reached because we currently have no TLD that is
+            // numbers only. But who knows..
+            // Better safe than sorry.
+            throw new GigiApiException("IP Addresses are not allowed");
+        }
         checkPunycode(parts[0], s.substring(parts[0].length() + 1));
     }