Changeset 1208
- Timestamp:
- 06/14/08 15:22:45
(3 months ago)
- Author:
- rats
- Message:
* Fixed #1344: Error with LocalPart? address checking
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1207 |
r1208 |
|
| 187 | 187 | |
|---|
| 188 | 188 | function chk_email($email, $num = 50) { |
|---|
| | 189 | if (strlen($email) > $num) |
|---|
| | 190 | return false; |
|---|
| | 191 | |
|---|
| 189 | 192 | // RegEx begin |
|---|
| 190 | 193 | $nonascii = "\x80-\xff"; # non ASCII chars are not allowed |
|---|
| … | … | |
| 204 | 207 | $regex = "$user_part\@$domain_part"; |
|---|
| 205 | 208 | // RegEx end |
|---|
| 206 | | if (!preg_match("/^$regex$/", $email)) |
|---|
| 207 | | return false; |
|---|
| 208 | | |
|---|
| 209 | | if (strlen($email) > $num) |
|---|
| 210 | | return false; |
|---|
| 211 | | |
|---|
| 212 | | return true; |
|---|
| | 209 | return (bool) preg_match("/^$regex$/", $email); |
|---|
| 213 | 210 | } |
|---|
| 214 | 211 | |
|---|
| … | … | |
| 230 | 227 | // RegEx end |
|---|
| 231 | 228 | return (bool) preg_match("/^$regex$/", $email); |
|---|
| 232 | | return false; |
|---|
| 233 | 229 | } |
|---|
| 234 | 230 | |
|---|
|
Download in other formats:
#########################################################################
# Site footer - Contents are automatically inserted after main Trac HTML
?>