Skip to content

Commit

Permalink
Merge branch 'PHP-5.3' into PHP-5.4
Browse files Browse the repository at this point in the history
# By Daniel Veillard
* PHP-5.3:
  Update to work with libxml 2.9.0
  • Loading branch information
Rob Richards committed Aug 9, 2012
2 parents c98a51a + c4b26cc commit c5a611b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/dom/documenttype.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
xmlOutputBufferFlush(buff);
#ifdef LIBXML2_NEW_BUFFER
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
#else
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
#endif
(void)xmlOutputBufferClose(buff);
return SUCCESS;
}
Expand Down
8 changes: 8 additions & 0 deletions ext/dom/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
RETVAL_FALSE;
} else {
if (mode == 0) {
#ifdef LIBXML2_NEW_BUFFER
ret = xmlOutputBufferGetSize(buf);
#else
ret = buf->buffer->use;
#endif
if (ret > 0) {
#ifdef LIBXML2_NEW_BUFFER
RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);
#else
RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
#endif
} else {
RETVAL_EMPTY_STRING();
}
Expand Down
4 changes: 4 additions & 0 deletions ext/simplexml/simplexml.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,11 @@ SXE_METHOD(asXML)

xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
xmlOutputBufferFlush(outbuf);
#ifdef LIBXML2_NEW_BUFFER
RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1);
#else
RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);
#endif
xmlOutputBufferClose(outbuf);
}
} else {
Expand Down

0 comments on commit c5a611b

Please sign in to comment.