luci-mod-network: fix logic bug in parse enc for network join 4561/head
authorAnsuel Smith <ansuelsmth@gmail.com>
Sun, 1 Nov 2020 00:51:02 +0000 (01:51 +0100)
committerAnsuel Smith <ansuelsmth@gmail.com>
Sun, 1 Nov 2020 00:51:02 +0000 (01:51 +0100)
commitba98a2fd0500a4f94680240255ae8c8034fea850
tree59e0a8c3c56e40ca49ea1edf1f6be37588a00ded
parentae47a5104d515bff83077f33e96fe6355504da1d
luci-mod-network: fix logic bug in parse enc for network join

In handleJoinConfirm while is_wep is a boolean, is_psk and is_sae are an array. In the following if check, all 3 are used as boolean but Js treat empty array as positive values and this cause the ui to wrongly set the encryption to sae. fix this by checking if the array actually contains data.

Fixes: #4524
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js