summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-12-02 13:57:05 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-12-02 13:57:05 +0100
commite8465b3e4f010248e32a7dfb1e73a32c764aa30d (patch)
tree8100b29942dfa623cc2ef1a92b43df637fe93d35
parent9b30357454ea53a9f1d7e82d8f894db5f409de98 (diff)
parent09768ed74596e70ab7270a6eb7c96fa4afd1d85d (diff)
Merge pull request #565 from yousong/l2tp-server
Allow host:port value for l2tp `server` option
-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"))