Commit 397bb12
[ruby/uri] Re-allow consecutive, leading and trailing dots in EMAIL_REGEXP
Effectively reverts commit ruby/uri@788274b180d6 and
ruby/uri@0abac721d8fe.
EMAIL_REGEXP was mostly drawn from WHATWG HTML LS. This spec states that
it intentionally violates RFC 5322 to provide a practical regex for
validation.
> This requirement is a willful violation of RFC 5322, which defines a
> syntax for email addresses that is simultaneously too strict (before the
> "@" character), too vague (after the "@" character), and too lax
> (allowing comments, whitespace characters, and quoted strings in manners
> unfamiliar to most users) to be of practical use here.
The allowing of consecutive dot s(`a..a@`) and leading/trailing dots
(`.a@`, `a.@`) is not the only derivation from RFC 5322. If a truly RFC
5322-compliant regexp is needed, tt should be organized under a
different name, since too much departure from the original EMAIL_REGEXP
must be introduced.
ruby/uri@c551d7020b1 parent 4478096 commit 397bb12
2 files changed
+11
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 55 | + | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
152 | 151 | | |
153 | | - | |
154 | | - | |
155 | | - | |
| 152 | + | |
| 153 | + | |
156 | 154 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 155 | + | |
| 156 | + | |
164 | 157 | | |
| 158 | + | |
165 | 159 | | |
166 | | - | |
| 160 | + | |
167 | 161 | | |
168 | 162 | | |
169 | 163 | | |
170 | | - | |
| 164 | + | |
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
| |||
0 commit comments