From 5ff3ef7cbb9719d3476feb836cac86ee421f666d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 19 Aug 2021 08:59:17 +0200 Subject: protocols: make APN option optional again Fixes: #5284 Fixes: 1661ac6bf8 ("luci-proto-ncm: add APN and PIN validation") Fixes: 114dc38dc2 ("luci-proto-qmi: add APN and PIN validation") Fixes: 6a8ad40b05 ("luci-proto-3g: add APN and PIN validation") Fixes: ebb676ef7b ("luci-proto-modemmanager: add APN and PIN validation") Signed-off-by: Jo-Philipp Wich --- protocols/luci-proto-3g/htdocs/luci-static/resources/protocol/3g.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'protocols/luci-proto-3g') 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'); -- cgit v1.2.3