mirror of
https://github.com/openwrt/luci
synced 2025-01-09 04:28:37 +08:00
luci-proto-wireguard: fix preshared key validation
Ensure that the preshared key option remains optional. Fixes: #3075 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
fbfb4af326
commit
995322c55f
@ -3,6 +3,9 @@
|
||||
'require network';
|
||||
|
||||
function validateBase64(section_id, value) {
|
||||
if (value.length == 0)
|
||||
return true;
|
||||
|
||||
if (value.length != 44 || !value.match(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/))
|
||||
return _('Invalid Base64 key string');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user