summaryrefslogtreecommitdiff
path: root/ext/soap
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-03-13 12:34:20 +0100
committerOndřej Surý <ondrej@sury.org>2013-03-13 12:34:20 +0100
commit92984f18f6aee9c0f719febb9fc09a0c50262c2f (patch)
tree36d95d0aa548ede359a4da5338cf1162890ab524 /ext/soap
parent7ad1f708d5748e36de4b51088b377907e5ea01e7 (diff)
downloadphp-92984f18f6aee9c0f719febb9fc09a0c50262c2f.tar.gz
Imported Upstream version 5.5.0~alpha6upstream/5.5.0_alpha6
Diffstat (limited to 'ext/soap')
-rw-r--r--ext/soap/php_xml.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index 737a335e3..939385557 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -20,6 +20,7 @@
/* $Id$ */
#include "php_soap.h"
+#include "ext/libxml/php_libxml.h"
#include "libxml/parser.h"
#include "libxml/parserInternals.h"
@@ -91,14 +92,17 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
ctxt = xmlCreateFileParserCtxt(filename);
PG(allow_url_fopen) = old_allow_url_fopen;
if (ctxt) {
+ zend_bool old;
+
ctxt->keepBlanks = 0;
- ctxt->options &= ~XML_PARSE_DTDLOAD;
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) {
@@ -129,12 +133,15 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
+ TSRMLS_FETCH();
+
/*
xmlInitParser();
*/
ctxt = xmlCreateMemoryParserCtxt(buf, buf_size);
if (ctxt) {
- ctxt->options &= ~XML_PARSE_DTDLOAD;
+ zend_bool old;
+
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
ctxt->sax->comment = soap_Comment;
ctxt->sax->warning = NULL;
@@ -143,7 +150,9 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
#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) {