summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-openvpn
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-openvpn')
-rw-r--r--applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
index 6433229f69..d5e0019eb7 100644
--- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
+++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua
@@ -56,7 +56,7 @@ function s.create(self, name)
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".text"
)
- if string.len(name)>3 and not name:match("[^a-zA-Z0-9_]") then
+ if #name > 3 and not name:match("[^a-zA-Z0-9_]") then
uci:section(
"openvpn", "openvpn", name,
uci:get_all( "openvpn_recipes", recipe )
@@ -67,9 +67,11 @@ function s.create(self, name)
uci:save("openvpn")
luci.http.redirect( self.extedit:format(name) )
- else
+ elseif #name > 0 then
self.invalid_cts = true
end
+
+ return 0
end