--- embedaddon/php/ext/soap/php_xml.c 2012/02/21 23:48:01 1.1 +++ embedaddon/php/ext/soap/php_xml.c 2013/07/22 01:32:01 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | 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 | @@ -17,9 +17,10 @@ | Dmitry Stogov | +----------------------------------------------------------------------+ */ -/* $Id: php_xml.c,v 1.1 2012/02/21 23:48:01 misho Exp $ */ +/* $Id: php_xml.c,v 1.1.1.3 2013/07/22 01:32:01 misho Exp $ */ #include "php_soap.h" +#include "ext/libxml/php_libxml.h" #include "libxml/parser.h" #include "libxml/parserInternals.h" @@ -91,13 +92,17 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRML ctxt = xmlCreateFileParserCtxt(filename); PG(allow_url_fopen) = old_allow_url_fopen; if (ctxt) { + zend_bool old; + ctxt->keepBlanks = 0; ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; ctxt->sax->error = NULL; /*ctxt->sax->fatalError = NULL;*/ + old = php_libxml_disable_entity_loader(1 TSRMLS_CC); xmlParseDocument(ctxt); + php_libxml_disable_entity_loader(old TSRMLS_CC); if (ctxt->wellFormed) { ret = ctxt->myDoc; if (ret->URL == NULL && ctxt->directory != NULL) { @@ -128,11 +133,15 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t xmlParserCtxtPtr ctxt = NULL; xmlDocPtr ret; + TSRMLS_FETCH(); + /* xmlInitParser(); */ ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); if (ctxt) { + zend_bool old; + ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; @@ -141,7 +150,9 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t #if LIBXML_VERSION >= 20703 ctxt->options |= XML_PARSE_HUGE; #endif + old = php_libxml_disable_entity_loader(1 TSRMLS_CC); xmlParseDocument(ctxt); + php_libxml_disable_entity_loader(old TSRMLS_CC); if (ctxt->wellFormed) { ret = ctxt->myDoc; if (ret->URL == NULL && ctxt->directory != NULL) { @@ -168,32 +179,6 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t */ return ret; } - -#ifndef ZEND_ENGINE_2 -int php_stream_xmlIO_match_wrapper(const char *filename) -{ - TSRMLS_FETCH(); - return php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ? 1 : 0; -} - -void *php_stream_xmlIO_open_wrapper(const char *filename) -{ - TSRMLS_FETCH(); - return php_stream_open_wrapper((char*)filename, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); -} - -int php_stream_xmlIO_read(void *context, char *buffer, int len) -{ - TSRMLS_FETCH(); - return php_stream_read((php_stream*)context, buffer, len); -} - -int php_stream_xmlIO_close(void *context) -{ - TSRMLS_FETCH(); - return php_stream_close((php_stream*)context); -} -#endif xmlNsPtr attr_find_ns(xmlAttrPtr node) {