diff options
author | Daniel F. Dickinson <cshored@thecshore.com> | 2019-01-05 00:43:37 -0500 |
---|---|---|
committer | Daniel F. Dickinson <cshored@thecshore.com> | 2019-01-05 00:43:37 -0500 |
commit | f5a871bfe89871dbdcf430ae8c81e46c15c1424a (patch) | |
tree | 94c1dfb0fbbdff4df1e962814afa8fc870dc2c92 /modules/luci-base/htdocs/luci-static | |
parent | 66c2bbc2790813a7889c0dd329131e5012fc83dd (diff) |
luci-base: Fix addr:port validate always fails
In cbi.js there is an error which causes ipaddrport validation to always fail.
JS match() return the entire match as ret[0] and individual matches (for multiple ()) as the
subsequent list members. So we fix it by just fixing the index in the calls that want the
individual parts.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index f93c9351a..67ddc6af3 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -443,10 +443,10 @@ var CBIValidatorPrototype = { m6 = this.value.match((bracket == 1) ? /^\[(.+)\]:(\d+)$/ : /^([^\[\]]+):(\d+)$/); if (m4) - return this.assert(this.apply('ip4addr', m4[0], [true]) && this.apply('port', m4[1]), + return this.assert(this.apply('ip4addr', m4[1], [true]) && this.apply('port', m4[2]), _('valid address:port')); - return this.assert(m6 && this.apply('ip6addr', m6[0], [true]) && this.apply('port', m6[1]), + return this.assert(m6 && this.apply('ip6addr', m6[1], [true]) && this.apply('port', m6[2]), _('valid address:port')); }, |