mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 20:59:12 +08:00
UrlValidator and EmailValidator IDN support fixes.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user