summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-base/luasrc/view/cbi/value.htm2
-rw-r--r--protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm
index 8a08e08f2..c43dab5f4 100644
--- a/modules/luci-base/luasrc/view/cbi/value.htm
+++ b/modules/luci-base/luasrc/view/cbi/value.htm
@@ -29,7 +29,7 @@
<%- end -%>');
<%- end %>
<% if self.datatype then -%>
- cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype:gsub("'", "\\'")%>');
+ cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype:gsub("\\", "\\\\"):gsub("'", "\\'")%>');
<%- end %>
//]]></script>
<% end -%>
diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua
index 523ef1bc6..5e8b3fcaa 100644
--- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua
+++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua
@@ -8,7 +8,7 @@ local ipv6, defaultroute, metric, peerdns, dns, mtu
server = section:taboption("general", Value, "server", translate("L2TP Server"))
-server.datatype = "host"
+server.datatype = "or(host, hostport)"
username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))