Skip to content
Browse files

Fix bug in XML escaping: "<" was being escaped as "&amp;lt;" instead …

…of "&lt;".
  • Loading branch information...
1 parent 8a3b669 commit b9c0b8fac93e578a3b221cc5cca03dc5534e20ea @davidlazar committed Oct 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 ASTToXML.ml
View
2 ASTToXML.ml
@@ -11,9 +11,9 @@ open Ast
(* escape XML chars *)
let escape_string str : string =
+ let str = Str.global_replace (Str.regexp "&") "&amp;" str in
let str = Str.global_replace (Str.regexp "<") "&lt;" str in
let str = Str.global_replace (Str.regexp ">") "&gt;" str in
- let str = Str.global_replace (Str.regexp "&") "&amp;" str in
let str = Str.global_replace (Str.regexp "'") "&apos;" str in
let str = Str.global_replace (Str.regexp "\"") "&quot;" str in
str

0 comments on commit b9c0b8f

Please sign in to comment.
Something went wrong with that request. Please try again.