From db2add9656048804ee237ef2e97d50eb49845e71 Mon Sep 17 00:00:00 2001 From: eribeiro Date: Tue, 9 Feb 2021 13:20:03 -0300 Subject: [PATCH] =?UTF-8?q?Conserta=20erro=20de=20renderiza=C3=A7=C3=A3o?= =?UTF-8?q?=20em=20pauta=20(OSTicket=20#113485)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 2e47a205e..6b1f5b114 100755 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -1225,8 +1225,23 @@ def get_pauta_sessao(sessao, casa): expedientes = [] for e in expediente: tipo = e.tipo - conteudo = re.sub( - ' ', ' ', strip_tags(e.conteudo.replace('
', '\n'))) + conteudo = e.conteudo + if not is_empty(conteudo): + # unescape HTML codes + # https://github.com/interlegis/sapl/issues/1046 + conteudo = re.sub('style=".*?"', '', conteudo) + conteudo = re.sub('class=".*?"', '', conteudo) + conteudo = re.sub('align=".*?"', '', conteudo) # OSTicket Ticket #796450 + conteudo = re.sub('', '

', conteudo) + conteudo = re.sub('', '
', conteudo) # OSTicket Ticket #796450 + conteudo = html.unescape(conteudo) + + # escape special character '&' + # https://github.com/interlegis/sapl/issues/1009 + conteudo = conteudo.replace('&', '&') + + # https://github.com/interlegis/sapl/issues/2386 + conteudo = remove_html_comments(conteudo) ex = {'tipo': tipo, 'conteudo': conteudo} expedientes.append(ex)