Flex 电子邮件验证器 - £域名中允许使用的符号
我在工作中需要修复一个错误,其中域名中允许使用英镑符号 £。
我检查了 EmailValidator 源代码,可以看到它不是不允许的符号,而美元符号之类的符号是:
public class EmailValidator extends Validator
{
include "../core/Version.as";
//--------------------------------------------------------------------------
//
// Class constants
//
//--------------------------------------------------------------------------
/**
* @private
*/
private static const DISALLOWED_LOCALNAME_CHARS:String =
"()<>,;:\\\"[] `~!#$%^&*={}|/?'";
/**
* @private
*/
private static const DISALLOWED_DOMAIN_CHARS:String =
"()<>,;:\\\"[] `~!#$%^&*+={}|/?'";
如您所见 DISALLOWED_DOMAIN_CHARS 字符串不包含 £ 符号。正在考虑猴子修补(基本上是复制整个类,编辑它,并将其添加到我的 src - 对于那些不知道的人),但我们使用 RSL,所以这会出现问题。
大家有什么想法吗?
I have a bug to fix in work where the UK Pound symbol, £, is allowed in the domain name.
I checked the EmailValidator source and can see that it is not a disallowed symbol, whereas things like the dollar sign are:
public class EmailValidator extends Validator
{
include "../core/Version.as";
//--------------------------------------------------------------------------
//
// Class constants
//
//--------------------------------------------------------------------------
/**
* @private
*/
private static const DISALLOWED_LOCALNAME_CHARS:String =
"()<>,;:\\\"[] `~!#$%^&*={}|/?'";
/**
* @private
*/
private static const DISALLOWED_DOMAIN_CHARS:String =
"()<>,;:\\\"[] `~!#$%^&*+={}|/?'";
As you can see DISALLOWED_DOMAIN_CHARS string does not include the £ sign. Was thinking of monkey patching (basically copying the entire class, editing it, and adding it to my src - for those not in the know), but we use RSL's, so that would be problematic.
Any ideas folks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您应该像这样重写类 mx.validators.EmailValidator 的方法 doValidation 而不是克隆一个
有帮助的类 Hopes
I think You should override the method doValidation of Class mx.validators.EmailValidator like this rather than clone a Class
Hopes that helps
为什么您需要禁止它?
这个反问句是由数字 42 以及字母 S 和 O 带来的。
还有许多其他符号,您不会要求专门禁止。我建议决定像现在一样将“仅少数”列入黑名单,或者完全重新考虑您的验证过程以采用白名单格式。
Why do you need to disallow it?
This rhetorical question brought to you by the number 42 and the letters S and O.
There are so many other symbols that you're not asking about specifically banning. I'd suggest deciding to blacklist "only a few" like you are now, or else completely rethink your validation process to a whitelist format.