UrlValidator and EmailValidator IDN support fixes.

This commit is contained in:
resurtm
2013-05-15 22:24:57 +06:00
parent 8a5e1f4f5f
commit 6458b8df8f
4 changed files with 13 additions and 11 deletions

View File

@@ -112,8 +112,9 @@ yii.validation = (function ($) {
var valid = true;
if (options.idn) {
var regexp = /^(.*)@(.*)$/, matches = regexp.exec(value);
if (options.enableIDN) {
var regexp = /^(.*)@(.*)$/,
matches = regexp.exec(value);
if (matches === null) {
valid = false;
} else {
@@ -137,8 +138,9 @@ yii.validation = (function ($) {
var valid = true;
if (options.idn) {
var regexp = /^([^:]+):\/\/([^\/]+)(.*)?/, matches = regexp.exec(value);
if (options.enableIDN) {
var regexp = /^([^:]+):\/\/([^\/]+)(.*)?/,
matches = regexp.exec(value);
if (matches === null) {
valid = false;
} else {