diff options
| author | Rob Richards <rrichards@php.net> | 2004-05-31 11:20:46 +0000 |
|---|---|---|
| committer | Rob Richards <rrichards@php.net> | 2004-05-31 11:20:46 +0000 |
| commit | 1d82c42493125f7fbdaf0a9bae6051070db885b4 (patch) | |
| tree | 01cf7653baea4eaff3c510cc1afe9dd723329c89 /ext/libxml/libxml.c | |
| parent | 846c5a252ec4f90319d15aa4cf24ec45b2a8ac06 (diff) | |
| download | php-git-1d82c42493125f7fbdaf0a9bae6051070db885b4.tar.gz | |
fix leak when using relaxng
interim fix for isolating our streams handling
- once libxml supports overriding streams this should be changed
for security reasons
Diffstat (limited to 'ext/libxml/libxml.c')
| -rw-r--r-- | ext/libxml/libxml.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index a6e68a21df..cb0519631a 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -40,6 +40,9 @@ #include <libxml/tree.h> #include <libxml/uri.h> #include <libxml/xmlerror.h> +#ifdef LIBXML_SCHEMAS_ENABLED +#include <libxml/relaxng.h> +#endif #include "php_libxml.h" @@ -241,7 +244,11 @@ static void php_libxml_init_globals(php_libxml_globals *libxml_globals_p TSRMLS_ int php_libxml_streams_IO_match_wrapper(const char *filename) { TSRMLS_FETCH(); - return php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC) ? 1 : 0; + + if (zend_is_executing(TSRMLS_C)) { + return php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC) ? 1 : 0; + } + return 0; } void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, const int read_only) @@ -408,6 +415,9 @@ PHP_LIBXML_API void php_libxml_initialize() { PHP_LIBXML_API void php_libxml_shutdown() { if (_php_libxml_initialized) { +#if defined(LIBXML_SCHEMAS_ENABLED) + xmlRelaxNGCleanupTypes(); +#endif xmlCleanupParser(); zend_hash_destroy(&php_libxml_exports); _php_libxml_initialized = 0; |
