forked from CGM_Public/pretix_original
Another attempt at correct sanitization of HTML in invoice content (#2279)
This commit is contained in:
@@ -550,7 +550,10 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
|||||||
for line in self.invoice.lines.all():
|
for line in self.invoice.lines.all():
|
||||||
if has_taxes:
|
if has_taxes:
|
||||||
tdata.append((
|
tdata.append((
|
||||||
Paragraph(line.description, self.stylesheet['Normal']),
|
Paragraph(
|
||||||
|
bleach.clean(line.description, tags=['br']).strip().replace('<br>', '<br/>').replace('\n', '<br />\n'),
|
||||||
|
self.stylesheet['Normal']
|
||||||
|
),
|
||||||
"1",
|
"1",
|
||||||
localize(line.tax_rate) + " %",
|
localize(line.tax_rate) + " %",
|
||||||
money_filter(line.net_value, self.invoice.event.currency),
|
money_filter(line.net_value, self.invoice.event.currency),
|
||||||
@@ -558,7 +561,10 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
|||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
tdata.append((
|
tdata.append((
|
||||||
Paragraph(line.description, self.stylesheet['Normal']),
|
Paragraph(
|
||||||
|
bleach.clean(line.description, tags=['br']).strip().replace('<br>', '<br/>').replace('\n', '<br />\n'),
|
||||||
|
self.stylesheet['Normal']
|
||||||
|
),
|
||||||
"1",
|
"1",
|
||||||
money_filter(line.gross_value, self.invoice.event.currency),
|
money_filter(line.gross_value, self.invoice.event.currency),
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user