Skip to content

Commit

Permalink
Merge pull request playframework#257 from martinp/lighthouse-886-patch
Browse files Browse the repository at this point in the history
[playframework#886] Fix validation problem with exclamation marks in URLs
  • Loading branch information
pepite committed Aug 31, 2011
2 parents a01e09a + 6d19dbe commit 96dc068
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/src/play/data/validation/URLCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -22,5 +23,5 @@ public boolean isSatisfied(Object validatedObject, Object value, OValContext con
}
return urlPattern.matcher(value.toString()).matches();
}

}

0 comments on commit 96dc068

Please sign in to comment.