mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 06:02:47 +08:00
SECURITY: prevents XSS when showing tooltip
This commit is contained in:
parent
612bc4f95b
commit
aafd883466
|
@ -1,10 +1,15 @@
|
|||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
|
||||
export function showTooltip() {
|
||||
const fadeSpeed = 300;
|
||||
const tooltipID = "#discourse-tooltip";
|
||||
const $this = $(this);
|
||||
const $parent = $this.offsetParent();
|
||||
const content = $this.attr("data-tooltip");
|
||||
const retina = window.devicePixelRatio && window.devicePixelRatio > 1 ? "class='retina'" : "";
|
||||
const content = escapeExpression($this.attr("data-tooltip"));
|
||||
const retina =
|
||||
window.devicePixelRatio && window.devicePixelRatio > 1
|
||||
? "class='retina'"
|
||||
: "";
|
||||
|
||||
let pos = $this.offset();
|
||||
const delta = $parent.offset();
|
||||
|
|
Loading…
Reference in New Issue
Block a user