1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

587663 Incorrect Attribute-Value Normalization

* parser.c: when replacing entities and that the entity is CDATA and
  reference entities then white space character in replacement text
  need to be replaced by 0x20
* result/noent/att10: correct the output of the associated regression
  test
This commit is contained in:
Daniel Veillard 2009-08-25 17:18:39 +02:00
parent eeb9932990
commit 283d50279d
2 changed files with 7 additions and 2 deletions

View File

@ -3705,7 +3705,12 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
if (rep != NULL) {
current = rep;
while (*current != 0) { /* non input consuming */
buf[len++] = *current++;
if ((*current == 0xD) || (*current == 0xA) ||
(*current == 0x9)) {
buf[len++] = 0x20;
current++;
} else
buf[len++] = *current++;
if (len > buf_size - 10) {
growBuffer(buf, 10);
}

View File

@ -10,7 +10,7 @@
]>
<doc>
<tst a="xyz" b=" xyz"/>
<tst a="&#13;&#13;A&#10; &#10;B&#13;&#10;" b="&#13;&#13;A&#10; &#10;B&#13;&#10;"/>
<tst a="A B" b=" A B "/>
<tst a="&#13;&#13;A&#10;&#10;B&#13;&#10;" b="&#13;&#13;A&#10;&#10;B&#13;&#10;"/>
<tst a="x y" b=" x y "/>
<tst a="a b" b=" a b "/>