summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-08-19 08:59:17 +0200
committerJo-Philipp Wich <jo@mein.io>2021-08-19 08:59:17 +0200
commit5ff3ef7cbb9719d3476feb836cac86ee421f666d (patch)
treec33e0fcf290aa6658a34fd9687686f4264090e35 /protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js
parent730ec8f29fb087550533a62cb5ce670eec642d02 (diff)
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 <jo@mein.io>
Diffstat (limited to 'protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js')
-rw-r--r--protocols/luci-proto-ncm/htdocs/luci-static/resources/protocol/ncm.js3
1 files changed, 3 insertions, 0 deletions
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');