* Fixed handling of ']' character in CDATA sections, when it is not starting a ']]>' delimiter it must be output as-is. Mantis #23794.

git-svn-id: trunk@23551 -
This commit is contained in:
sergei 2013-01-31 15:01:00 +00:00
parent 7e79042d58
commit f5a8f69517

View File

@ -384,12 +384,17 @@ end;
procedure CDSectSpecialCharCallback(Sender: TXMLWriter; const s: DOMString;
var idx: Integer);
begin
if (idx <= Length(s)-2) and (s[idx+1] = ']') and (s[idx+2] = '>') then
if s[idx]=']' then
begin
Sender.wrtStr(']]]]><![CDATA[>');
Inc(idx, 2);
// TODO: emit warning 'cdata-section-splitted'
end
if (idx <= Length(s)-2) and (s[idx+1] = ']') and (s[idx+2] = '>') then
begin
Sender.wrtStr(']]]]><![CDATA[>');
Inc(idx, 2);
// TODO: emit warning 'cdata-section-splitted'
end
else
Sender.wrtChr(']');
end
else
raise EConvertError.Create('Illegal character');
end;