mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 18:08:33 +08:00
SECURITY: prevents XSS when showing tooltip
This commit is contained in:
parent
6bcdc3ba4b
commit
b5b847f6d6
|
@ -1,9 +1,11 @@
|
||||||
|
import { escapeExpression } from "discourse/lib/utilities";
|
||||||
|
|
||||||
export function showTooltip() {
|
export function showTooltip() {
|
||||||
const fadeSpeed = 300;
|
const fadeSpeed = 300;
|
||||||
const tooltipID = "#discourse-tooltip";
|
const tooltipID = "#discourse-tooltip";
|
||||||
const $this = $(this);
|
const $this = $(this);
|
||||||
const $parent = $this.offsetParent();
|
const $parent = $this.offsetParent();
|
||||||
const content = $this.attr("data-tooltip");
|
const content = escapeExpression($this.attr("data-tooltip"));
|
||||||
const retina =
|
const retina =
|
||||||
window.devicePixelRatio && window.devicePixelRatio > 1
|
window.devicePixelRatio && window.devicePixelRatio > 1
|
||||||
? "class='retina'"
|
? "class='retina'"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user