mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 23:09:10 +08:00
Merge pull request #10320 from tafid/ip-validator-js
Fixed client-side IP validator
This commit is contained in:
@@ -341,9 +341,9 @@ yii.validation = (function ($) {
|
|||||||
|
|
||||||
var matches = new RegExp(options.ipParsePattern).exec(value);
|
var matches = new RegExp(options.ipParsePattern).exec(value);
|
||||||
if (matches) {
|
if (matches) {
|
||||||
negation = (matches[1] !== '') ? matches[1] : null;
|
negation = matches[1] || null;
|
||||||
cidr = (matches[4] !== '') ? matches[4] : null;
|
|
||||||
value = matches[2];
|
value = matches[2];
|
||||||
|
cidr = matches[4] || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.subnet === true && cidr === null) {
|
if (options.subnet === true && cidr === null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user