summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-07-04 11:15:32 +0800
committerChristoph M. Becker <cmbecker69@gmx.de>2018-08-17 13:01:55 +0200
commit10d724d82d6471a7808b46c186b5b8ded68e79d5 (patch)
tree6bdad9c2ad50893e6a67dccfd41d36c7527f236e
parent2072d377d3f0380f1f77768746d196106673db8d (diff)
downloadphp-git-10d724d82d6471a7808b46c186b5b8ded68e79d5.tar.gz
Fixed build
(cherry picked from commit 36f05a80d7cf11fffb827c7f0b6c8e73d3846e8e)
-rw-r--r--ext/dom/document.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 9c3ece5ac3..6bbc0500b9 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -2186,7 +2186,11 @@ PHP_FUNCTION(dom_document_save_html)
for (node = node->children; node; node = node->next) {
htmlNodeDumpFormatOutput(outBuf, docp, node, NULL, format);
+#ifdef LIBXML2_NEW_BUFFER
one_size = !outBuf->error ? xmlOutputBufferGetSize(outBuf) : -1;
+#else
+ one_size = !outBuf->error ? outBuf->buffer->use : -1;
+#endif
if (one_size >= 0) {
size = one_size;
} else {
@@ -2196,10 +2200,18 @@ PHP_FUNCTION(dom_document_save_html)
}
} else {
htmlNodeDumpFormatOutput(outBuf, docp, node, NULL, format);
+#ifdef LIBXML2_NEW_BUFFER
size = !outBuf->error ? xmlOutputBufferGetSize(outBuf): -1;
+#else
+ size = !outBuf->error ? outBuf->buffer->use : -1;
+#endif
}
if (size >= 0) {
+#ifdef LIBXML2_NEW_BUFFER
mem = (xmlChar*) xmlOutputBufferGetContent(outBuf);
+#else
+ mem = (xmlChar*) outBuf->buffer->content;
+#endif
if (!mem) {
RETVAL_FALSE;
} else {