Skip to content

Commit c5a611b

Browse files
author
Rob Richards
committed
Merge branch 'PHP-5.3' into PHP-5.4
# By Daniel Veillard * PHP-5.3: Update to work with libxml 2.9.0
2 parents c98a51a + c4b26cc commit c5a611b

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
@@ -1417,7 +1417,11 @@ SXE_METHOD(asXML)
14171417

14181418
xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
14191419
xmlOutputBufferFlush(outbuf);
1420+
#ifdef LIBXML2_NEW_BUFFER
1421+
RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1);
1422+
#else
14201423
RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);
1424+
#endif
14211425
xmlOutputBufferClose(outbuf);
14221426
}
14231427
} else {

0 commit comments

Comments
 (0)