comparison libervia/pages/blog/view/page_meta.py @ 1229:acec8e9185db

pages: replaced deprecated `cgi.escape` by `html.escape`
author Goffi <goffi@goffi.org>
date Mon, 18 Nov 2019 21:49:42 +0100
parents 0f0c36992f3c
children f511f8fbbf8a
comparison
equal deleted inserted replaced
1228:f3edbca73713 1229:acec8e9185db
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 import unicodedata 3 import unicodedata
4 import re 4 import re
5 import cgi 5 import html
6 from libervia.server.constants import Const as C 6 from libervia.server.constants import Const as C
7 from twisted.words.protocols.jabber import jid 7 from twisted.words.protocols.jabber import jid
8 from twisted.internet import defer 8 from twisted.internet import defer
9 from sat.tools.common import data_objects 9 from sat.tools.common import data_objects
10 from libervia.server import session_iface 10 from libervia.server import session_iface
233 if bg_img: 233 if bg_img:
234 template_data['dynamic_style'] = safe(""" 234 template_data['dynamic_style'] = safe("""
235 :root { 235 :root {
236 --bg-img: url("%s"); 236 --bg-img: url("%s");
237 } 237 }
238 """ % cgi.escape(bg_img, True)) 238 """ % html.escape(bg_img, True))
239 239
240 template_data['items'] = data['items'] = items 240 template_data['items'] = data['items'] = items
241 if request.args.get(b'reverse') == ['1']: 241 if request.args.get(b'reverse') == ['1']:
242 template_data['items'].items.reverse() 242 template_data['items'].items.reverse()
243 template_data['items_http_uri'] = items_http_uri = {} 243 template_data['items_http_uri'] = items_http_uri = {}