diff --git a/public/language/en-GB/topic.json b/public/language/en-GB/topic.json index 9027774603..f970d11654 100644 --- a/public/language/en-GB/topic.json +++ b/public/language/en-GB/topic.json @@ -152,6 +152,7 @@ "bookmarks.has-no-bookmarks": "You haven't bookmarked any posts yet.", "copy-permalink": "Copy Permalink", + "go-to-original": "View Original Post", "loading-more-posts": "Loading More Posts", "move-topic": "Move Topic", diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.js index 44b488216e..f156ff82f2 100644 --- a/src/socket.io/posts/tools.js +++ b/src/socket.io/posts/tools.js @@ -36,7 +36,8 @@ module.exports = function (SocketPosts) { }); const postData = results.posts; - postData.absolute_url = `${nconf.get('url')}/post/${data.pid}`; + postData.pid = data.pid; + postData.absolute_url = `${nconf.get('url')}/post/${encodeURIComponent(data.pid)}`; postData.bookmarked = results.bookmarked; postData.selfPost = socket.uid && socket.uid === postData.uid; postData.display_edit_tools = results.canEdit.flag; @@ -48,6 +49,7 @@ module.exports = function (SocketPosts) { postData.display_change_owner_tools = results.isAdmin || results.isModerator; postData.display_ip_ban = (results.isAdmin || results.isGlobalMod) && !postData.selfPost; postData.display_history = results.history && results.canViewHistory; + postData.display_original_url = !utils.isNumber(data.pid); postData.flags = { flagId: parseInt(results.posts.flagId, 10) || null, can: results.canFlag.flag,