Commit dbadeb72 authored by Dietmar Maurer's avatar Dietmar Maurer

fix IPAddress vtype

parent 8ee71a18
...@@ -31,7 +31,7 @@ var IPV6_H16 = "(?:[0-9a-fA-F]{1,4})"; ...@@ -31,7 +31,7 @@ var IPV6_H16 = "(?:[0-9a-fA-F]{1,4})";
var IPV6_LS32 = "(?:(?:" + IPV6_H16 + ":" + IPV6_H16 + ")|" + IPV4_REGEXP + ")"; var IPV6_LS32 = "(?:(?:" + IPV6_H16 + ":" + IPV6_H16 + ")|" + IPV4_REGEXP + ")";
var IP4_match = new RegExp("^(" + IPV4_REGEXP + ")$"); var IP4_match = new RegExp("^(?:" + IPV4_REGEXP + ")$");
var IPV6_REGEXP = "(?:" + var IPV6_REGEXP = "(?:" +
"(?:(?:" + "(?:" + IPV6_H16 + ":){6})" + IPV6_LS32 + ")|" + "(?:(?:" + "(?:" + IPV6_H16 + ":){6})" + IPV6_LS32 + ")|" +
...@@ -45,12 +45,12 @@ var IPV6_REGEXP = "(?:" + ...@@ -45,12 +45,12 @@ var IPV6_REGEXP = "(?:" +
"(?:(?:(?:(?:" + IPV6_H16 + ":){0,7}" + IPV6_H16 + ")?::" + ")" + ")" + "(?:(?:(?:(?:" + IPV6_H16 + ":){0,7}" + IPV6_H16 + ")?::" + ")" + ")" +
")"; ")";
var IP64_match = new RegExp("^(?:" + IPV6_REGEXP + ")$"); var IP64_match = new RegExp("^(?:" + IPV6_REGEXP + "|" + IPV4_REGEXP + ")$");
// custom Vtypes // custom Vtypes
Ext.apply(Ext.form.field.VTypes, { Ext.apply(Ext.form.field.VTypes, {
IPAddress: function(v) { IPAddress: function(v) {
return IP64_match.test(v); return IP4_match.test(v);
}, },
IPAddressText: gettext('Example') + ': 192.168.1.1', IPAddressText: gettext('Example') + ': 192.168.1.1',
IPAddressMask: /[\d\.]/i, IPAddressMask: /[\d\.]/i,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment