Move first batch of util fns to graph-parser.util

Still need to fix external.roam
This commit is contained in:
Gabriel Horner
2022-05-03 16:59:41 -04:00
parent af4b55c870
commit 85bd1fecb2
43 changed files with 211 additions and 166 deletions

View File

@@ -1,6 +1,6 @@
(ns frontend.security
(:require [clojure.walk :as walk]
[frontend.util :as util]))
[logseq.graph-parser.util :as gp-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))
(util/safe-re-find #"(?i)javascript" (:href (second f)))))
(gp-util/safe-re-find #"(?i)javascript" (:href (second f)))))
(defn remove-javascript-links-in-href
[hiccup]