diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-04-14 17:02:42 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-04-14 17:03:43 +0200 |
commit | 6ae1cd8fdbd438574270fa9586f40e223fec40e6 (patch) | |
tree | f1a4fa3387d0d122b77057bd1c761a29eb1b8649 /modules/luci-base | |
parent | d0daa2c47b0f556a39e98b8deab1ab2471c274ae (diff) |
luci-base: uci.js: do not issue malformed uci/delete requests
Fixes: #3912
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ec3a202b69b5bf5785c0785b2ac39efbe5cae2b7)
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/uci.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/uci.js b/modules/luci-base/htdocs/luci-static/resources/uci.js index f97cd8e35..e6582b3e2 100644 --- a/modules/luci-base/htdocs/luci-static/resources/uci.js +++ b/modules/luci-base/htdocs/luci-static/resources/uci.js @@ -553,9 +553,13 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ { c[conf][sid] = {}; /* undelete option */ - if (d[conf] && d[conf][sid]) + if (d[conf] && d[conf][sid]) { d[conf][sid] = d[conf][sid].filter(function(o) { return o !== opt }); + if (d[conf][sid].length == 0) + delete d[conf][sid]; + } + c[conf][sid][opt] = val; } else { |