Permalink
Browse files

Merge pull request #257 from martinp/lighthouse-886-patch

[#886] Fix validation problem with exclamation marks in URLs
  • Loading branch information...
1 parent f86a8af commit a9df30867d808a6e25272171332bd01c385cc997 @pepite pepite committed Aug 31, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 framework/src/play/data/validation/URLCheck.java
@@ -9,7 +9,8 @@
public class URLCheck extends AbstractAnnotationCheck<URL> {
final static String mes = "validation.url";
- static Pattern urlPattern = Pattern.compile("^(http|https|ftp)\\://[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\\-\\._\\?\\,\\'/\\\\\\+&amp;%\\$#\\=~])*$");
+ static Pattern urlPattern = Pattern.compile("^(http|https|ftp)\\://[a-zA-Z0-9\\-\\.]+\\.[a-z" +
+ "A-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\\-\\._\\?\\,\\'/\\\\\\+&amp;%\\$#\\=~\\!])*$");
@Override
public void configure(URL url) {
@@ -22,5 +23,5 @@ public boolean isSatisfied(Object validatedObject, Object value, OValContext con
}
return urlPattern.matcher(value.toString()).matches();
}
-
+
}

0 comments on commit a9df308

Please sign in to comment.