Skip to content

Commit

Permalink
use much safer regexp pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
leizhe authored and andelf committed Jan 11, 2022
1 parent 02e3db1 commit aed7ef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/frontend/db/model.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,9 +1062,9 @@
db-utils/group-by-page))))))

(defn- pattern [name]
(re-pattern (str "(?i)(?!#)(?!\\[\\[)"
(re-pattern (str "(?i)(^|[^\\[#0-9a-zA-Z]|((^|[^\\[])\\[))"
(util/regex-escape name)
"(?!\\]\\])")))
"($|[^0-9a-zA-Z])")))

(defn get-page-unlinked-references
[page]
Expand Down

0 comments on commit aed7ef8

Please sign in to comment.