Mercurial > libervia-web
changeset 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 | f3edbca73713 |
children | b32b74dfe866 |
files | libervia/pages/blog/view/page_meta.py libervia/pages/events/admin/page_meta.py libervia/pages/events/rsvp/page_meta.py libervia/pages/events/view/page_meta.py |
diffstat | 4 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libervia/pages/blog/view/page_meta.py Mon Nov 18 21:46:12 2019 +0100 +++ b/libervia/pages/blog/view/page_meta.py Mon Nov 18 21:49:42 2019 +0100 @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import unicodedata import re -import cgi +import html from libervia.server.constants import Const as C from twisted.words.protocols.jabber import jid from twisted.internet import defer @@ -235,7 +235,7 @@ :root { --bg-img: url("%s"); } - """ % cgi.escape(bg_img, True)) + """ % html.escape(bg_img, True)) template_data['items'] = data['items'] = items if request.args.get(b'reverse') == ['1']:
--- a/libervia/pages/events/admin/page_meta.py Mon Nov 18 21:46:12 2019 +0100 +++ b/libervia/pages/events/admin/page_meta.py Mon Nov 18 21:49:42 2019 +0100 @@ -8,7 +8,7 @@ from sat.core.i18n import _ from sat.core.log import getLogger import time -import cgi +import html import math import re @@ -59,7 +59,7 @@ background-size: 15em; } """ - % cgi.escape(background_image, True) + % html.escape(background_image, True) ) template_data["event"] = event_data invitees = yield self.host.bridgeCall( @@ -137,7 +137,7 @@ for invitee_jid_s in jids.split(): try: invitee_jid = jid.JID(invitee_jid_s) - except RuntimeError as e: + except RuntimeError: log.warning( _("this is not a valid jid: {jid}").format(jid=invitee_jid_s) )
--- a/libervia/pages/events/rsvp/page_meta.py Mon Nov 18 21:46:12 2019 +0100 +++ b/libervia/pages/events/rsvp/page_meta.py Mon Nov 18 21:49:42 2019 +0100 @@ -8,7 +8,7 @@ from sat.core.log import getLogger from sat.tools.common.template import safe import time -import cgi +import html """creation of new events""" @@ -58,7 +58,7 @@ background-size: 15em; } """ - % cgi.escape(background_image, True) + % html.escape(background_image, True) ) template_data["event"] = event_data event_invitee_data = yield self.host.bridgeCall(
--- a/libervia/pages/events/view/page_meta.py Mon Nov 18 21:46:12 2019 +0100 +++ b/libervia/pages/events/view/page_meta.py Mon Nov 18 21:49:42 2019 +0100 @@ -9,7 +9,7 @@ from sat.tools.common import uri from sat.tools.common.template import safe import time -import cgi +import html from sat.core.log import getLogger name = "event_view" @@ -55,7 +55,7 @@ background-size: 15em; } """ - % cgi.escape(background_image, True) + % html.escape(background_image, True) ) template_data["event"] = event_data event_invitee_data = yield self.host.bridgeCall(