I recently learned that email addresses with apostrophes in are perfectly valid (according to the RFC document which covers such things) however Able doesn't seem to like them - attempting to sign in with an email with an apostrophe just returns a user not found message. Has anyone had any experience with this?
Stepping through the login process I can see that the (first) failing function is UserDataSource.LoadForUserName() so I'm guessing I'll need to modify the core Able code? We have the source available, so that's not too bad, but if anyone has any advice on this before I set off on an impossible adventure I'd appreciate it!
Email Addresses with Apostrophes?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Email Addresses with Apostrophes?
You could try replacing Able's email validator with a custom one using a different Regex. This is what Able uses:
You might also want to add Able's safe sql string code around the input, replacing the single apostrophe with two to guard against sql injection attacks.
public static string SafeSqlString(string str)
{
if (str == null)
{
return string.Empty;
}
return str.Replace("'", "''");
}
For example, it would be something like StringHelper.SafeSqlString(AddEmail.Text)
Code: Select all
public static string EmailRegex
{
get
{
return @"^[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2,6}$";
}
}
public static string SafeSqlString(string str)
{
if (str == null)
{
return string.Empty;
}
return str.Replace("'", "''");
}
For example, it would be something like StringHelper.SafeSqlString(AddEmail.Text)
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
- crockettdunn
- Lieutenant Commander (LCDR)
- Posts: 105
- Joined: Sun Oct 26, 2008 6:32 pm
- Contact:
Re: Email Addresses with Apostrophes?
Did this work out for you? I've just run into email-address-with-apostrophe problems, too.
I'll search my files for, "public static string EmailRegex." I'd certainly appreciate it if anyone could point me to the specific file to get started.
Thanks!
I'll search my files for, "public static string EmailRegex." I'd certainly appreciate it if anyone could point me to the specific file to get started.
Thanks!