mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
fix: #10096, don't display preview for links if hostname doesnt match
This commit is contained in:
@@ -209,8 +209,9 @@ define('forum/topic', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
const href = link.attr('href');
|
const href = link.attr('href');
|
||||||
const validHref = href && href !== '#';
|
const location = utils.urlToLocation(href);
|
||||||
const pathname = utils.urlToLocation(href).pathname;
|
const pathname = location.pathname;
|
||||||
|
const validHref = href && href !== '#' && window.location.hostname === location.hostname;
|
||||||
$('#post-tooltip').remove();
|
$('#post-tooltip').remove();
|
||||||
const postMatch = validHref && pathname && pathname.match(/\/post\/([\d]+)/);
|
const postMatch = validHref && pathname && pathname.match(/\/post\/([\d]+)/);
|
||||||
const topicMatch = validHref && pathname && pathname.match(/\/topic\/([\d]+)/);
|
const topicMatch = validHref && pathname && pathname.match(/\/topic\/([\d]+)/);
|
||||||
|
|||||||
Reference in New Issue
Block a user