[
https://issues.apache.org/jira/browse/TAPESTRY-1857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537200
]
Ulrich Stärk commented on TAPESTRY-1857:
----------------------------------------
That pattern has several flaws:
1.) domain names with several successive '.' will pass (e.g. [EMAIL PROTECTED])
2.) characters commonly found in local parts like '+' are not covered by '\w'
3.) RFC 3696 (http://tools.ietf.org/html/rfc3696) says: "The LDH rule, as
updated, provides that the labels (words or strings separated by periods) that
make up a domain name must consist of only the ASCII [ASCII] alphabetic and
numeric characters, plus the hyphen." '\w' also contains the underscore char
('_') thus allowing for invalid domains.
As to your wonderings :-)
a) they are
b) at least in the local part we should support single chars
c) there will always be tradeoffs you have to make. if you want to be fully rfc
compliant you'd have to use someting like
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html as you mentioned
earlier. the pattern i provided addresses the 3 points mentioned above. it has
one mistake though, i mixed up the quantifier at some points, will fix that
right away.
> Email validator's regexp pattern causes possibly infinite loop
> --------------------------------------------------------------
>
> Key: TAPESTRY-1857
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1857
> Project: Tapestry
> Issue Type: Bug
> Components: Framework
> Affects Versions: 4.1.3
> Reporter: Ulrich Stärk
> Assignee: Andreas Andreou
> Priority: Blocker
> Fix For: 4.1.4
>
> Attachments: patch.txt, Test.java
>
>
> The regex pattern used by the email validator causes a possibly infinite loop
> in java.util.regex.Pattern with some input.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]