diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2009-03-01 17:40:26 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2009-03-01 17:40:26 +0100 |
commit | f11c7a49e3b87ea00c84e408bf7c69ab7fbd30c1 (patch) | |
tree | 4bc7175b92436afd45eb7b0628d9782fcea8561d | |
parent | 5201711033af05c875f83ef0bdaeefb82e57806b (diff) |
Defensively escape XML text.
-rw-r--r-- | cljssss-g.clj | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cljssss-g.clj b/cljssss-g.clj index b473cb6..d919abc 100644 --- a/cljssss-g.clj +++ b/cljssss-g.clj @@ -185,7 +185,9 @@ to merely being replaced with a div element)?" (defn escape-xml [string] (str-utils/re-gsub #"<" "<" - (str-utils/re-gsub #">" ">" string))) + (str-utils/re-gsub #">" ">" + (str-utils/re-gsub #"&" "&" + string)))) (defn escape-string [string] (str-utils/re-gsub #"\"" "\\\\\"" string)) |