From a115b771f061302e30c3e0a6f08fdad01604e47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 22 Dec 2021 10:55:30 -0500 Subject: [PATCH] fix: #10096, don't display preview for links if hostname doesnt match --- public/src/client/topic.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index 231377967e..636a9d7593 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -209,8 +209,9 @@ define('forum/topic', [ } const href = link.attr('href'); - const validHref = href && href !== '#'; - const pathname = utils.urlToLocation(href).pathname; + const location = utils.urlToLocation(href); + const pathname = location.pathname; + const validHref = href && href !== '#' && window.location.hostname === location.hostname; $('#post-tooltip').remove(); const postMatch = validHref && pathname && pathname.match(/\/post\/([\d]+)/); const topicMatch = validHref && pathname && pathname.match(/\/topic\/([\d]+)/);