diff options
4 files changed, 12 insertions, 0 deletions
diff --git a/protocols/luci-proto-3g/htdocs/luci-static/resources/protocol/3g.js b/protocols/luci-proto-3g/htdocs/luci-static/resources/protocol/3g.js index d0d8b4a677..a1c54984a6 100644 --- a/protocols/luci-proto-3g/htdocs/luci-static/resources/protocol/3g.js +++ b/protocols/luci-proto-3g/htdocs/luci-static/resources/protocol/3g.js @@ -94,6 +94,9 @@ return network.registerProtocol('3g', { o = s.taboption('general', form.Value, 'apn', _('APN')); o.validate = function(section_id, value) { + if (value == null || value == '') + return true; + if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value)) return _('Invalid APN provided'); diff --git a/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js b/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js index 88e516a8ec..501f759646 100644 --- a/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js +++ b/protocols/luci-proto-modemmanager/htdocs/luci-static/resources/protocol/modemmanager.js @@ -93,6 +93,9 @@ return network.registerProtocol('modemmanager', { o = s.taboption('general', form.Value, 'apn', _('APN')); o.validate = function(section_id, value) { + if (value == null || value == '') + return true; + if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value)) return _('Invalid APN provided'); diff --git a/protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js b/protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js index 4d2f446793..95b5297811 100644 --- a/protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js +++ b/protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js @@ -86,6 +86,9 @@ return network.registerProtocol('ncm', { o = s.taboption('general', form.Value, 'apn', _('APN')); o.validate = function(section_id, value) { + if (value == null || value == '') + return true; + if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value)) return _('Invalid APN provided'); diff --git a/protocols/luci-proto-qmi/htdocs/luci-static/resources/protocol/qmi.js b/protocols/luci-proto-qmi/htdocs/luci-static/resources/protocol/qmi.js index def275a1c6..98ae486d37 100644 --- a/protocols/luci-proto-qmi/htdocs/luci-static/resources/protocol/qmi.js +++ b/protocols/luci-proto-qmi/htdocs/luci-static/resources/protocol/qmi.js @@ -67,6 +67,9 @@ return network.registerProtocol('qmi', { o = s.taboption('general', form.Value, 'apn', _('APN')); o.validate = function(section_id, value) { + if (value == null || value == '') + return true; + if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value)) return _('Invalid APN provided'); |