summaryrefslogtreecommitdiff
path: root/ext/soap/php_xml.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2013-02-20 22:27:41 +0400
committerDmitry Stogov <dmitry@zend.com>2013-02-20 22:27:41 +0400
commitc737b89473df9dba6742b8fc8fbf6d009bf05c36 (patch)
tree5d067fae4757d65bd66f57bab59c1a0dec0dc56c /ext/soap/php_xml.c
parent021f57ef0e21868f6bbef34c4b1a1a2bf5461159 (diff)
parent8e76d0404b7f664ee6719fd98f0483f0ac4669d6 (diff)
downloadphp-git-c737b89473df9dba6742b8fc8fbf6d009bf05c36.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed external entity loading Conflicts: ext/libxml/libxml.c ext/libxml/php_libxml.h
Diffstat (limited to 'ext/soap/php_xml.c')
-rw-r--r--ext/soap/php_xml.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index 737a335e3a..a74ec02f43 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);
xmlParseDocument(ctxt);
+ php_libxml_disable_entity_loader(old);
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
@@ -134,7 +138,8 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
*/
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 +148,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);
xmlParseDocument(ctxt);
+ php_libxml_disable_entity_loader(old);
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {