mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-10-30 01:24:11 +00:00
Avoid probably invalid postId from creating bad icon links
This commit is contained in:
1 parent
9daad0bd5c
commit
709e2803d1
1 file changed
+23
-5
+23
-5
@@ -390,7 +390,11 @@ def _getReplyIconHtml(baseDir: str, nickname: str, domain: str,
|
|||||||
return replyStr
|
return replyStr
|
||||||
|
|
||||||
# reply is permitted - create reply icon
|
# reply is permitted - create reply icon
|
||||||
replyToLink = removeIdEnding(postJsonObject['object']['id'])
|
if '#' not in postJsonObject['object']['id']:
|
||||||
|
replyToLink = removeIdEnding(postJsonObject['object']['id'])
|
||||||
|
else:
|
||||||
|
replyToLink = \
|
||||||
|
removeIdEnding(postJsonObject['object']['id'].split('#')[0])
|
||||||
|
|
||||||
# see Mike MacGirvin's replyTo suggestion
|
# see Mike MacGirvin's replyTo suggestion
|
||||||
if postJsonObject['object'].get('replyTo'):
|
if postJsonObject['object'].get('replyTo'):
|
||||||
@@ -639,7 +643,10 @@ def _getLikeIconHtml(nickname: str, domainFull: str,
|
|||||||
likeStr += '<label class="likesCount">'
|
likeStr += '<label class="likesCount">'
|
||||||
likeStr += likeCountStr.replace('(', '').replace(')', '').strip()
|
likeStr += likeCountStr.replace('(', '').replace(')', '').strip()
|
||||||
likeStr += '</label>\n'
|
likeStr += '</label>\n'
|
||||||
likePostId = removeIdEnding(postJsonObject['id'])
|
if '#' not in postJsonObject['id']:
|
||||||
|
likePostId = removeIdEnding(postJsonObject['id'])
|
||||||
|
else:
|
||||||
|
likePostId = removeIdEnding(postJsonObject['id'].split('#')[0])
|
||||||
likeStr += \
|
likeStr += \
|
||||||
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
|
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
|
||||||
likeLink + '=' + likePostId + \
|
likeLink + '=' + likePostId + \
|
||||||
@@ -685,7 +692,11 @@ def _getBookmarkIconHtml(nickname: str, domainFull: str,
|
|||||||
if translate.get(bookmarkTitle):
|
if translate.get(bookmarkTitle):
|
||||||
bookmarkTitle = translate[bookmarkTitle]
|
bookmarkTitle = translate[bookmarkTitle]
|
||||||
_logPostTiming(enableTimingLog, postStartTime, '12.6')
|
_logPostTiming(enableTimingLog, postStartTime, '12.6')
|
||||||
bookmarkPostId = removeIdEnding(postJsonObject['object']['id'])
|
if '#' not in postJsonObject['object']['id']:
|
||||||
|
bookmarkPostId = removeIdEnding(postJsonObject['object']['id'])
|
||||||
|
else:
|
||||||
|
bookmarkPostId = \
|
||||||
|
removeIdEnding(postJsonObject['object']['id'].split('#')[0])
|
||||||
bookmarkStr = \
|
bookmarkStr = \
|
||||||
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
|
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
|
||||||
bookmarkLink + '=' + bookmarkPostId + \
|
bookmarkLink + '=' + bookmarkPostId + \
|
||||||
@@ -722,7 +733,11 @@ def _getReactionIconHtml(nickname: str, domainFull: str,
|
|||||||
if translate.get(reactionTitle):
|
if translate.get(reactionTitle):
|
||||||
reactionTitle = translate[reactionTitle]
|
reactionTitle = translate[reactionTitle]
|
||||||
_logPostTiming(enableTimingLog, postStartTime, '12.65')
|
_logPostTiming(enableTimingLog, postStartTime, '12.65')
|
||||||
reactionPostId = removeIdEnding(postJsonObject['object']['id'])
|
if '#' not in postJsonObject['object']['id']:
|
||||||
|
reactionPostId = removeIdEnding(postJsonObject['object']['id'])
|
||||||
|
else:
|
||||||
|
reactionPostId = \
|
||||||
|
removeIdEnding(postJsonObject['object']['id'].split('#')[0])
|
||||||
reactionStr = \
|
reactionStr = \
|
||||||
' <a class="imageAnchor" href="/users/' + nickname + \
|
' <a class="imageAnchor" href="/users/' + nickname + \
|
||||||
'?selreact=' + reactionPostId + pageNumberParam + \
|
'?selreact=' + reactionPostId + pageNumberParam + \
|
||||||
@@ -1364,7 +1379,10 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
|
|||||||
avatarPosition = ''
|
avatarPosition = ''
|
||||||
messageId = ''
|
messageId = ''
|
||||||
if postJsonObject.get('id'):
|
if postJsonObject.get('id'):
|
||||||
messageId = removeIdEnding(postJsonObject['id'])
|
if '#' not in postJsonObject['id']:
|
||||||
|
messageId = removeIdEnding(postJsonObject['id'])
|
||||||
|
else:
|
||||||
|
messageId = removeIdEnding(postJsonObject['id'].split('#')[0])
|
||||||
|
|
||||||
_logPostTiming(enableTimingLog, postStartTime, '2')
|
_logPostTiming(enableTimingLog, postStartTime, '2')
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user