Don't allow HTML in ping messages

This commit is contained in:
Tulir Asokan 2019-07-08 10:55:07 +03:00
parent 6268749a2e
commit d325076c9f

View file

@ -45,7 +45,7 @@ class EchoBot(Plugin):
msgtype=MessageType.NOTICE, format=Format.HTML, msgtype=MessageType.NOTICE, format=Format.HTML,
body=f"{evt.sender}: Pong! (ping {message} {pretty_diff} to arrive)", body=f"{evt.sender}: Pong! (ping {message} {pretty_diff} to arrive)",
formatted_body=f"<a href='https://matrix.to/#/{evt.sender}'>{evt.sender}</a>: Pong! " formatted_body=f"<a href='https://matrix.to/#/{evt.sender}'>{evt.sender}</a>: Pong! "
f"(<a href='https://matrix.to/#/{evt.room_id}/{evt.event_id}'>ping</a> {message} " f"(<a href='https://matrix.to/#/{evt.room_id}/{evt.event_id}'>ping</a> {html_message} "
f"{pretty_diff} to arrive)") f"{pretty_diff} to arrive)")
content["pong"] = { content["pong"] = {
"ms": diff, "ms": diff,