aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2009-03-01 17:40:26 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2009-03-01 17:40:26 +0100
commitf11c7a49e3b87ea00c84e408bf7c69ab7fbd30c1 (patch)
tree4bc7175b92436afd45eb7b0628d9782fcea8561d
parent5201711033af05c875f83ef0bdaeefb82e57806b (diff)
Defensively escape XML text.
-rw-r--r--cljssss-g.clj4
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 #"<" "&#60;"
- (str-utils/re-gsub #">" "&#62;" string)))
+ (str-utils/re-gsub #">" "&#62;"
+ (str-utils/re-gsub #"&" "&#38;"
+ string))))
(defn escape-string [string]
(str-utils/re-gsub #"\"" "\\\\\"" string))