--- embedaddon/php/ext/soap/php_xml.c 2012/05/29 12:34:42 1.1.1.2 +++ 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.1.2 2012/05/29 12:34:42 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) {