-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp-5.2.17-libxml2.patch
54 lines (53 loc) · 1.84 KB
/
php-5.2.17-libxml2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index 000c03b..b064c60 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -215,7 +215,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;
}
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 0d2bc77..3234342 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -1950,9 +1950,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();
}
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 64a6514..203b52b 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1343,7 +1343,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 {