version 1.1.1.2, 2012/05/29 12:34:37
|
version 1.1.1.4, 2014/06/15 20:03:42
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 1509 char *_dom_get_valid_file_path(char *source, char *res
|
Line 1509 char *_dom_get_valid_file_path(char *source, char *res
|
|
|
if (uri->scheme != NULL) { |
if (uri->scheme != NULL) { |
/* absolute file uris - libxml only supports localhost or empty host */ |
/* absolute file uris - libxml only supports localhost or empty host */ |
|
#ifdef PHP_WIN32 |
|
if (strncasecmp(source, "file://",7) == 0 && ':' == source[8]) { |
|
isFileUri = 1; |
|
source += 7; |
|
} else |
|
#endif |
if (strncasecmp(source, "file:///",8) == 0) { |
if (strncasecmp(source, "file:///",8) == 0) { |
isFileUri = 1; |
isFileUri = 1; |
#ifdef PHP_WIN32 |
#ifdef PHP_WIN32 |
Line 2296 PHP_FUNCTION(dom_document_save_html)
|
Line 2302 PHP_FUNCTION(dom_document_save_html)
|
xmlBufferPtr buf; |
xmlBufferPtr buf; |
dom_object *intern, *nodeobj; |
dom_object *intern, *nodeobj; |
xmlChar *mem = NULL; |
xmlChar *mem = NULL; |
int size, format; | int size = 0, format; |
dom_doc_propsptr doc_props; |
dom_doc_propsptr doc_props; |
|
|
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), |
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), |
Line 2324 PHP_FUNCTION(dom_document_save_html)
|
Line 2330 PHP_FUNCTION(dom_document_save_html)
|
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
size = htmlNodeDump(buf, docp, node); | if (node->type == XML_DOCUMENT_FRAG_NODE) { |
| int one_size; |
| |
| for (node = node->children; node; node = node->next) { |
| one_size = htmlNodeDump(buf, docp, node); |
| |
| if (one_size >= 0) { |
| size += one_size; |
| } else { |
| size = -1; |
| break; |
| } |
| } |
| } else { |
| size = htmlNodeDump(buf, docp, node); |
| } |
if (size >= 0) { |
if (size >= 0) { |
mem = (xmlChar*) xmlBufferContent(buf); |
mem = (xmlChar*) xmlBufferContent(buf); |
if (!mem) { |
if (!mem) { |