summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-10-25 16:01:25 +0200
committerOndřej Surý <ondrej@sury.org>2012-10-25 16:01:25 +0200
commitb57a2691d5b72c3894e2d4e0f945cecc6b3a1953 (patch)
tree012a1408ce8a738d45ae429ca7d7f5389c159915 /ext/dom
parent45c0aa447e02c80bd21a23245574231a110cf5a1 (diff)
downloadphp-b57a2691d5b72c3894e2d4e0f945cecc6b3a1953.tar.gz
Imported Upstream version 5.4.8upstream/5.4.8
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/documenttype.c4
-rw-r--r--ext/dom/domerrorhandler.c2
-rw-r--r--ext/dom/element.c4
-rw-r--r--ext/dom/node.c8
4 files changed, 15 insertions, 3 deletions
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index d61ba796a..eee3b5f88 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -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;
}
diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c
index f1ab2871a..e282f3014 100644
--- a/ext/dom/domerrorhandler.c
+++ b/ext/dom/domerrorhandler.c
@@ -29,7 +29,7 @@
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1)
- ZEND_ARG_OBJ_INFO(0, error, DOMError, 0)
+ ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0)
ZEND_END_ARG_INFO();
/* }}} */
diff --git a/ext/dom/element.c b/ext/dom/element.c
index c6a190212..02fded9f1 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -832,7 +832,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
}
if (errorcode == 0 && is_xmlns == 0) {
- attr = xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value);
+ xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value);
}
} else {
name_valid = xmlValidateName((xmlChar *) localname, 0);
@@ -844,7 +844,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) {
node_list_unlink(attr->children TSRMLS_CC);
}
- attr = xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value);
+ xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value);
}
}
}
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 4e58421e4..4dbce4d79 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -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();
}