Skip to content

Commit c4b26cc

Browse files
veillardRob Richards
authored andcommitted
Update to work with libxml 2.9.0
1 parent ed793b2 commit c4b26cc

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ext/dom/documenttype.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
205205
if (buff != NULL) {
206206
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
207207
xmlOutputBufferFlush(buff);
208+
#ifdef LIBXML2_NEW_BUFFER
209+
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
210+
#else
208211
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
212+
#endif
209213
(void)xmlOutputBufferClose(buff);
210214
return SUCCESS;
211215
}

ext/dom/node.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
18951895
RETVAL_FALSE;
18961896
} else {
18971897
if (mode == 0) {
1898+
#ifdef LIBXML2_NEW_BUFFER
1899+
ret = xmlOutputBufferGetSize(buf);
1900+
#else
18981901
ret = buf->buffer->use;
1902+
#endif
18991903
if (ret > 0) {
1904+
#ifdef LIBXML2_NEW_BUFFER
1905+
RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);
1906+
#else
19001907
RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
1908+
#endif
19011909
} else {
19021910
RETVAL_EMPTY_STRING();
19031911
}

ext/simplexml/simplexml.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,11 @@ SXE_METHOD(asXML)
13871387

13881388
xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
13891389
xmlOutputBufferFlush(outbuf);
1390+
#ifdef LIBXML2_NEW_BUFFER
1391+
RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1);
1392+
#else
13901393
RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);
1394+
#endif
13911395
xmlOutputBufferClose(outbuf);
13921396
}
13931397
} else {

0 commit comments

Comments
 (0)