summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2011-01-19 00:22:06 (GMT)
committerGustavo André dos Santos Lopes <cataphract@php.net>2011-01-19 00:22:06 (GMT)
commitfdbc42611c9997fdcd875c21b17c74a5b0c57362 (patch)
tree1017d84dca1d070bf78452a5bee1a1faccb08aa2 /ext/dom
parent0a35d91854cbfe5928976cc173403a59d1bd7e0d (diff)
downloadphp-fdbc42611c9997fdcd875c21b17c74a5b0c57362.tar.gz
- Hopefully finally fixed the mess in rev 307562 and rev 307563.
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/document.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 684bb3c..2d7df36 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -1821,7 +1821,7 @@ PHP_FUNCTION(dom_document_savexml)
saveempty = xmlSaveNoEmptyTags;
xmlSaveNoEmptyTags = 1;
}
- htmlNodeDumpFormatOutput(buf, docp, node, 0, format);
+ xmlNodeDump(buf, docp, node, 0, format);
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
@@ -2318,12 +2318,17 @@ PHP_FUNCTION(dom_document_save_html)
RETURN_FALSE;
}
- xmlNodeDump(buf, docp, node, 0, format);
- mem = (xmlChar*) xmlBufferContent(buf);
- if (!mem) {
- RETVAL_FALSE;
+ size = htmlNodeDump(buf, docp, node);
+ if (size >= 0) {
+ mem = (xmlChar*) xmlBufferContent(buf);
+ if (!mem) {
+ RETVAL_FALSE;
+ } else {
+ RETVAL_STRINGL((const char*) mem, size, 1);
+ }
} else {
- RETVAL_STRING(mem, 1);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error dumping HTML node");
+ RETVAL_FALSE;
}
xmlBufferFree(buf);
} else {
@@ -2335,7 +2340,7 @@ PHP_FUNCTION(dom_document_save_html)
if (!size) {
RETVAL_FALSE;
} else {
- RETVAL_STRINGL(mem, size, 1);
+ RETVAL_STRINGL((const char*) mem, size, 1);
}
if (mem)
xmlFree(mem);