Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_blog_import_dotclear.py @ 4329:73d83cb53673
plugin blog import dotclear: repalce deprecated `cgi` by `html`
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 20 Nov 2024 14:35:09 +0100 |
parents | 4b842c1fb686 |
children |
comparison
equal
deleted
inserted
replaced
4328:f72d6b86f8dc | 4329:73d83cb53673 |
---|---|
26 from libervia.backend.tools.common import data_format | 26 from libervia.backend.tools.common import data_format |
27 from twisted.internet import threads | 27 from twisted.internet import threads |
28 from collections import OrderedDict | 28 from collections import OrderedDict |
29 import itertools | 29 import itertools |
30 import time | 30 import time |
31 import cgi | 31 import html |
32 import os.path | 32 import os.path |
33 | 33 |
34 | 34 |
35 PLUGIN_INFO = { | 35 PLUGIN_INFO = { |
36 C.PI_NAME: "Dotclear import", | 36 C.PI_NAME: "Dotclear import", |
186 comment = self.parseFields(headers, data) | 186 comment = self.parseFields(headers, data) |
187 if comment["comment_site"]: | 187 if comment["comment_site"]: |
188 # we don't use atom:uri because it's used for jid in XMPP | 188 # we don't use atom:uri because it's used for jid in XMPP |
189 content = '{}\n<hr>\n<a href="{}">author website</a>'.format( | 189 content = '{}\n<hr>\n<a href="{}">author website</a>'.format( |
190 comment["comment_content"], | 190 comment["comment_content"], |
191 cgi.escape(comment["comment_site"]).replace('"', "%22"), | 191 html.escape(comment["comment_site"]).replace('"', "%22"), |
192 ) | 192 ) |
193 else: | 193 else: |
194 content = comment["comment_content"] | 194 content = comment["comment_content"] |
195 mb_data = { | 195 mb_data = { |
196 "id": self.get_comment_id(comment), | 196 "id": self.get_comment_id(comment), |