mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 15:29:26 +01:00
* Escape '>' characters in attribute values, resolves #19831
git-svn-id: trunk@18032 -
This commit is contained in:
parent
8bb66f5e07
commit
7e102d12ca
@ -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('	');
|
||||
#10: Sender.wrtStr('
');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user