mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 14:49:07 +08:00
FIX: Do not track a elements with no href.
This commit is contained in:
parent
b81d169e2a
commit
b9339e15a1
|
@ -10,7 +10,11 @@ export function isValidLink($link) {
|
||||||
// - links with disabled tracking
|
// - links with disabled tracking
|
||||||
// - category links
|
// - category links
|
||||||
// - quote back button
|
// - quote back button
|
||||||
if ($link.is(".lightbox, .mention, .mention-group, .no-track-link, .hashtag, .back")) {
|
if (
|
||||||
|
$link.is(
|
||||||
|
".lightbox, .mention, .mention-group, .no-track-link, .hashtag, .back"
|
||||||
|
)
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,10 +67,8 @@ export default {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let href = ($link.attr("href") || $link.data("href")).trim();
|
let href = ($link.attr("href") || $link.data("href") || "").trim();
|
||||||
if (!href) {
|
if (!href || href.indexOf("mailto:") === 0) {
|
||||||
return false;
|
|
||||||
} else if (href.indexOf("mailto:") === 0) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user