version 1.1, 2012/02/21 23:48:01
|
version 1.1.1.3, 2013/07/22 01:32:01
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| 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, | |
| 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 20
|
Line 20
|
/* $Id$ */ |
/* $Id$ */ |
|
|
#include "php_soap.h" |
#include "php_soap.h" |
|
#include "ext/libxml/php_libxml.h" |
#include "libxml/parser.h" |
#include "libxml/parser.h" |
#include "libxml/parserInternals.h" |
#include "libxml/parserInternals.h" |
|
|
Line 91 xmlDocPtr soap_xmlParseFile(const char *filename TSRML
|
Line 92 xmlDocPtr soap_xmlParseFile(const char *filename TSRML
|
ctxt = xmlCreateFileParserCtxt(filename); |
ctxt = xmlCreateFileParserCtxt(filename); |
PG(allow_url_fopen) = old_allow_url_fopen; |
PG(allow_url_fopen) = old_allow_url_fopen; |
if (ctxt) { |
if (ctxt) { |
|
zend_bool old; |
|
|
ctxt->keepBlanks = 0; |
ctxt->keepBlanks = 0; |
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; |
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; |
ctxt->sax->comment = soap_Comment; |
ctxt->sax->comment = soap_Comment; |
ctxt->sax->warning = NULL; |
ctxt->sax->warning = NULL; |
ctxt->sax->error = NULL; |
ctxt->sax->error = NULL; |
/*ctxt->sax->fatalError = NULL;*/ |
/*ctxt->sax->fatalError = NULL;*/ |
|
old = php_libxml_disable_entity_loader(1 TSRMLS_CC); |
xmlParseDocument(ctxt); |
xmlParseDocument(ctxt); |
|
php_libxml_disable_entity_loader(old TSRMLS_CC); |
if (ctxt->wellFormed) { |
if (ctxt->wellFormed) { |
ret = ctxt->myDoc; |
ret = ctxt->myDoc; |
if (ret->URL == NULL && ctxt->directory != NULL) { |
if (ret->URL == NULL && ctxt->directory != NULL) { |
Line 128 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t
|
Line 133 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t
|
xmlParserCtxtPtr ctxt = NULL; |
xmlParserCtxtPtr ctxt = NULL; |
xmlDocPtr ret; |
xmlDocPtr ret; |
|
|
|
TSRMLS_FETCH(); |
|
|
/* |
/* |
xmlInitParser(); |
xmlInitParser(); |
*/ |
*/ |
ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); |
ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); |
if (ctxt) { |
if (ctxt) { |
|
zend_bool old; |
|
|
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; |
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; |
ctxt->sax->comment = soap_Comment; |
ctxt->sax->comment = soap_Comment; |
ctxt->sax->warning = NULL; |
ctxt->sax->warning = NULL; |
Line 141 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t
|
Line 150 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t
|
#if LIBXML_VERSION >= 20703 |
#if LIBXML_VERSION >= 20703 |
ctxt->options |= XML_PARSE_HUGE; |
ctxt->options |= XML_PARSE_HUGE; |
#endif |
#endif |
|
old = php_libxml_disable_entity_loader(1 TSRMLS_CC); |
xmlParseDocument(ctxt); |
xmlParseDocument(ctxt); |
|
php_libxml_disable_entity_loader(old TSRMLS_CC); |
if (ctxt->wellFormed) { |
if (ctxt->wellFormed) { |
ret = ctxt->myDoc; |
ret = ctxt->myDoc; |
if (ret->URL == NULL && ctxt->directory != NULL) { |
if (ret->URL == NULL && ctxt->directory != NULL) { |
Line 168 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t
|
Line 179 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t
|
*/ |
*/ |
return ret; |
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) |
xmlNsPtr attr_find_ns(xmlAttrPtr node) |
{ |
{ |