luci/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm
Jo-Philipp Wich eda8f02dac treewide: avoid double-escaping CBI section labels
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>
2019-02-12 08:32:02 +01:00

47 lines
1.5 KiB
HTML

<%#
Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
This is free software, licensed under the Apache License, Version 2.0
-%>
<%-
local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous"
-%>
<%+adblock/adblock_css%>
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title then -%>
<h3><%=self.title%></h3>
<%- end %>
<div class="cbi-section-descr"><%=self.description%></div>
<div class="cbi-section-node">
<div class="table cbi-section-table">
<div class="tr cbi-section-table-titles <%=anonclass%>">
<%- for i, k in pairs(self.children) do -%>
<div class="th cbi-section-table-cell">
<%-=k.title-%>
</div>
<%- end -%>
</div>
<%- local section, scope, isempty = true
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, true)
isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<div class="tr cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>"<%=sectiontitle%>>
<%-
for k, node in ipairs(self.children) do
node:render(section, scope or {})
end
if not scope.cbid:match("adb_src_cat") then
-%>
<div class="td cbi-value-field">&#160;</div>
<%- end -%>
</div>
<%- end -%>
</div>
</div>
</div>