From 862b84feb2bc860c049b4b6fa990f92291cb4728 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 25 Nov 2015 22:39:27 +0800 Subject: [PATCH 1/2] luci-base: fix escaping lua string to js repr Signed-off-by: Yousong Zhou --- modules/luci-base/luasrc/view/cbi/value.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm index 8a08e08f2f..c43dab5f4b 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 %> //]]> <% end -%> From 09768ed74596e70ab7270a6eb7c96fa4afd1d85d Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 18 Nov 2015 13:34:24 +0800 Subject: [PATCH 2/2] luci-proto-ppp: l2tp: allow specifying port in "server" option Signed-off-by: Yousong Zhou --- .../luasrc/model/cbi/admin_network/proto_l2tp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 523ef1bc6f..5e8b3fcaae 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"))