treewide: avoid double-escaping CBI section labels
authorJo-Philipp Wich <jo@mein.io>
Tue, 12 Feb 2019 07:32:02 +0000 (08:32 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 12 Feb 2019 07:32:02 +0000 (08:32 +0100)
Since the section labels are already HTML-escaped implicitely by the
striptags() function, we must not escape them again in attr() or
ifattr().

Fixes: #2524
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm
applications/luci-app-banip/luasrc/view/banip/sourcelist.htm
modules/luci-base/luasrc/view/cbi/cell_valueheader.htm
modules/luci-base/luasrc/view/cbi/tblsection.htm

index e145a3b4ef4f30b08b6ab4666288cf828cd6cb19..c90afe7687cd439c9602a2d4a9cf97a550727fd2 100644 (file)
@@ -27,7 +27,7 @@ local anonclass  = (not self.anonymous or self.sectiontitle) and "named" or "ano
                                for i, k in ipairs(self:cfgsections()) do
                                        section = k
                                        local sectionname  = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k)
-                                       local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname)
+                                       local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname, true)
                                        isempty = false
                                        scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
                        -%>
index 743886f88442252cbc06250e6ce3dcae406ca781..12240e5ae46a616eb3763753814ffb744bd272f4 100644 (file)
@@ -27,7 +27,7 @@ local anonclass  = (not self.anonymous or self.sectiontitle) and "named" or "ano
                                for i, k in ipairs(self:cfgsections()) do
                                        section = k
                                        local sectionname  = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k)
-                                       local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname)
+                                       local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname, true)
                                        isempty = false
                                        scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
                        -%>
index ea0568f4097e490b4163c884412ad7a9b02e1be5..cb11d8f61a1a884ffe532381dd34780509cd6398 100644 (file)
@@ -6,7 +6,7 @@
 <div class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %>"<%=
        attr("data-name", self.option) ..
        ifattr(ftype and #ftype > 0, "data-type", ftype) ..
-       ifattr(title and #title > 0, "data-title", title) ..
-       ifattr(descr and #descr > 0, "data-description", descr)
+       ifattr(title and #title > 0, "data-title", title, true) ..
+       ifattr(descr and #descr > 0, "data-description", descr, true)
 %>>
 <div id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>">
index 408dfa7fe807feed7f4dd654dea7dd427f566408..11c2206d8ca1b794f868c7d87f3b18ed82d70018 100644 (file)
@@ -127,7 +127,7 @@ end
                                section = k
 
                                local sectionname = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k)
-                               local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname)
+                               local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname, true)
                                local colorclass = (self.extedit or self.rowcolors) and rowstyle() or ""
                                local scope = {
                                        valueheader = "cbi/cell_valueheader",