From 862b84feb2bc860c049b4b6fa990f92291cb4728 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 25 Nov 2015 22:39:27 +0800 Subject: 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(-) (limited to 'modules') 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 -%> -- cgit v1.2.3