From 2887fb2661de76589bac431d12131035ced977ca Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 6 Dec 2020 15:35:49 +0000 Subject: [PATCH] Broken link substitute for reply image in post --- webapp_post.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 000e063f..6b00a93f 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -772,6 +772,10 @@ def getPostTitleAnnounceHtml(baseDir: str, if announceAvatarUrl: idx = 'Show options for this person' if '/users/news/' not in announceAvatarUrl: + brokenLinkSubstitute = \ + " onerror=\"this.onerror=null; this.src='" + \ + iconsPath + "/avatar_default.png'\"" + replyAvatarImageInPost = \ ' ' \ '
' \ ' \n
\n' else: titleStr += \ @@ -959,6 +964,10 @@ def getPostTitleReplyHtml(baseDir: str, logPostTiming(enableTimingLog, postStartTime, '13.8') if replyAvatarUrl: + brokenLinkSubstitute = \ + " onerror=\"this.onerror=null; this.src='" + \ + iconsPath + "/avatar_default.png'\"" + replyAvatarImageInPost = \ '
\n' @@ -979,8 +988,8 @@ def getPostTitleReplyHtml(baseDir: str, translate['Show profile'] replyAvatarImageInPost += \ '" alt=" "' + \ - avatarPosition + '/>\n' + \ - '
\n' + avatarPosition + brokenLinkSubstitute + \ + '/>\n \n' else: inReplyTo = \ postJsonObject['object']['inReplyTo']