From e706bbd36237abc6c63d3e30cdaf9a42ac458215 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Tue, 28 Jul 2015 15:10:35 +0200 Subject: Fixing bug #4281: Better escaping of XML attributes. --- lib/xml_lexer.mll | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/xml_lexer.mll') diff --git a/lib/xml_lexer.mll b/lib/xml_lexer.mll index a33be9da7..f6943dd13 100644 --- a/lib/xml_lexer.mll +++ b/lib/xml_lexer.mll @@ -281,6 +281,11 @@ and dq_string = parse Buffer.add_char tmp (lexeme_char lexbuf 1); dq_string lexbuf } + | '&' + { + Buffer.add_string tmp (entity lexbuf); + dq_string lexbuf + } | eof { raise (Error EUnterminatedString) } | _ @@ -297,6 +302,11 @@ and q_string = parse Buffer.add_char tmp (lexeme_char lexbuf 1); q_string lexbuf } + | '&' + { + Buffer.add_string tmp (entity lexbuf); + q_string lexbuf + } | eof { raise (Error EUnterminatedString) } | _ -- cgit v1.2.3