From: Yousong Zhou Date: Wed, 25 Nov 2015 14:39:27 +0000 (+0800) Subject: luci-base: fix escaping lua string to js repr X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=862b84feb2bc860c049b4b6fa990f92291cb4728 luci-base: fix escaping lua string to js repr Signed-off-by: Yousong Zhou --- 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 %> //]]> <% end -%>