luci-proto-mbim: correctness fixes

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2026-05-22 15:28:16 +03:00
parent c3b03826fa
commit bd19e6b868
@@ -64,6 +64,7 @@ return network.registerProtocol('mbim', {
o = s.taboption('general', form.Value, 'apn', _('APN')); o = s.taboption('general', form.Value, 'apn', _('APN'));
o.validate = function(section_id, value) { o.validate = function(section_id, value) {
if (value == null || value == '') return true;
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value)) if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
return _('Invalid APN provided'); return _('Invalid APN provided');