mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 03:16:37 +00:00
Decouple graph-parser util from app util usage
For tiny util heavily used fns like safe-re-find and uuid-string?, decouple graph-parser from so much of the app
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
(ns frontend.security
|
||||
(:require [clojure.walk :as walk]
|
||||
[logseq.graph-parser.util :as gp-util]))
|
||||
[frontend.util :as util]))
|
||||
|
||||
;; To prevent from cross-site scripting vulnerability, we should add security checks for both hiccup and raw html.
|
||||
;; Hiccup: [:a {:href "javascript:alert('hei')"} "click me"]
|
||||
@@ -12,7 +12,7 @@
|
||||
(= :a (first f))
|
||||
(:href (second f))
|
||||
(:href (second f))
|
||||
(gp-util/safe-re-find #"(?i)javascript" (:href (second f)))))
|
||||
(util/safe-re-find #"(?i)javascript" (:href (second f)))))
|
||||
|
||||
(defn remove-javascript-links-in-href
|
||||
[hiccup]
|
||||
|
||||
Reference in New Issue
Block a user