Project

General

Profile

Actions

Bug #1909

closed

Capital letters in email field not allowed

Added by nant over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02 August 2010
Due date:
% Done:

100%

Estimated time:
0:12 h


Files

1909.patch (920 Bytes) 1909.patch krileon, 17 August 2010 19:52
Actions #1

Updated by krileon over 13 years ago

Confirmed, issue is with the REGEX used to validate emails in the function cbIsValidEmail. It is a case sensitive REGEX.

FROM:
/[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/@

TO: (case non-sensitive flag added)
/[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i@

TO: (capitals added)
/[a-zA-Z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+\\/=?^_`{|}~-]+)*(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/@

Also, there appears to be double escaping on periods, am not sure why so did not remove but double escaping a period is invalid as you're escaping the escape.

Actions #2

Updated by krileon over 13 years ago

  • Assignee set to beat

I believe the double escaping is due to stripslashes being applied to the regex. This would cause it to require double escaping.

Actions #3

Updated by krileon over 13 years ago

added case insensitive flag

Actions #4

Updated by krileon over 13 years ago

  • Status changed from New to Resolved
Actions #5

Updated by krileon over 13 years ago

  • Target version set to CB 1.3
Actions #6

Updated by beat over 13 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100
  • Estimated time set to 0:12 h

Patch committed in r1249 .

The double escaping of \ is to have a correctly escaped PHP string.... "\\" gives a single \ ;-)

Thank you Kyle.

Actions

Also available in: Atom PDF