* Escape '>' characters in attribute values, resolves #19831

git-svn-id: trunk@18032 -
This commit is contained in:
sergei 2011-07-29 01:38:26 +00:00
parent 8bb66f5e07
commit 7e102d12ca

View File

@ -130,7 +130,7 @@ end;
---------------------------------------------------------------------}
const
AttrSpecialChars = ['<', '"', '&', #9, #10, #13];
AttrSpecialChars = ['<', '>', '"', '&', #9, #10, #13];
TextSpecialChars = ['<', '>', '&', #10, #13];
CDSectSpecialChars = [']'];
LineEndingChars = [#13, #10];
@ -312,6 +312,12 @@ begin
'"': Sender.wrtStr(QuotStr);
'&': Sender.wrtStr(AmpStr);
'<': Sender.wrtStr(ltStr);
// This is *only* to interoperate with broken parsers out there,
// Delphi ClientDataset parser being one of them.
'>': if not Sender.FCanonical then
Sender.wrtStr(gtStr)
else
Sender.wrtChr('>');
// Escape whitespace using CharRefs to be consistent with W3 spec § 3.3.3
#9: Sender.wrtStr('&#x9;');
#10: Sender.wrtStr('&#xA;');