summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2010-04-02 20:08:15 +0000
committerRob Richards <rrichards@php.net>2010-04-02 20:08:15 +0000
commit0758c8794d382b2a9afe7046b7bbe2b067848bbe (patch)
tree1eb4a11a462a6720569b2706e0a3b6d840af9f8a
parent9744284109487efe079100f1e2ab4723e2bf6ee3 (diff)
downloadphp-git-0758c8794d382b2a9afe7046b7bbe2b067848bbe.tar.gz
fix bug #48983 (DomDocument : saveHTMLFile wrong charset)
-rw-r--r--NEWS1
-rw-r--r--ext/dom/document.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 24932af55a..2b0f47950c 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,7 @@ PHP NEWS
- Fixed bug #49192 (PHP crashes when GC invoked on COM object). (Stas)
- Fixed bug #49059 (DateTime::diff() repeats previous sub() operation).
(yoarvi@gmail.com, Derick)
+- Fixed bug #48983 (DomDocument : saveHTMLFile wrong charset). (Rob)
- Fixed bug #48902 (Timezone database fallback map is outdated). (Derick)
- Fixed bug #46111 (Some timezone identifiers can not be parsed). (Derick)
- Fixed bug #35673 (formatOutput does not work with saveHTML). (Rob)
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 5b8e3c6efa..2eda7b72ad 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -2252,6 +2252,7 @@ PHP_FUNCTION(dom_document_save_html_file)
dom_object *intern;
dom_doc_propsptr doc_props;
char *file;
+ const char *encoding;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
return;
@@ -2264,11 +2265,12 @@ PHP_FUNCTION(dom_document_save_html_file)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- /* encoding handled by property on doc */
+
+ encoding = (const char *) htmlGetMetaEncoding(docp);
doc_props = dom_get_doc_props(intern->document);
format = doc_props->formatoutput;
- bytes = htmlSaveFileFormat(file, docp, NULL, format);
+ bytes = htmlSaveFileFormat(file, docp, encoding, format);
if (bytes == -1) {
RETURN_FALSE;