1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

fixed bug #59981 related to handling of '&' in attributes when entities

* parser.c result/noent/wml.xml: fixed bug #59981 related
  to handling of '&' in attributes when entities are substitued
Daniel
This commit is contained in:
Daniel Veillard
2001-09-11 09:27:09 +00:00
parent 7cf5e44827
commit 319a742a50
3 changed files with 43 additions and 24 deletions

View File

@ -1,3 +1,8 @@
Tue Sep 11 11:25:36 CEST 2001 Daniel Veillard <daniel@veillard.com>
* parser.c result/noent/wml.xml: fixed bug #59981 related
to handling of '&' in attributes when entities are substitued
Mon Sep 10 22:14:42 CEST 2001 Daniel Veillard <daniel@veillard.com>
* libxml.h include/libxml/xmlversion.h.in

View File

@ -2212,6 +2212,12 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
(c != '<')) || (ctxt->token != 0)) {
if (c == 0) break;
if (ctxt->token == '&') {
if (ctxt->replaceEntities) {
if (len > buf_size - 10) {
growBuffer(buf);
}
buf[len++] = '&';
} else {
/*
* The reparsing will be done in xmlStringGetNodeList()
* called by the attribute() function in SAX.c
@ -2226,10 +2232,17 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
buf[len++] = *current++;
}
ctxt->token = 0;
}
} else if (c == '&') {
if (NXT(1) == '#') {
int val = xmlParseCharRef(ctxt);
if (val == '&') {
if (ctxt->replaceEntities) {
if (len > buf_size - 10) {
growBuffer(buf);
}
buf[len++] = '&';
} else {
/*
* The reparsing will be done in xmlStringGetNodeList()
* called by the attribute() function in SAX.c
@ -2243,6 +2256,7 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
while (*current != 0) { /* non input consuming */
buf[len++] = *current++;
}
}
} else {
if (len > buf_size - 10) {
growBuffer(buf);

View File

@ -3,7 +3,7 @@
<wml>
<card id="card1" title="Rubriques 75008">
<p>
<a href="rubmenu.asp?CP=75008&amp;#38;RB=01">Cin&#xE9;ma</a><br/>
<a href="rubmenu.asp?CP=75008&amp;RB=01">Cin&#xE9;ma</a><br/>
</p>
</card>