diff options
author | Christian Stocker <chregu@php.net> | 2003-12-01 08:18:35 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2003-12-01 08:18:35 +0000 |
commit | 80d552496cccce8c4253585ef5cb7b95d6824683 (patch) | |
tree | 91b898dff89b16da0dc1e08ecc34a5de964833df | |
parent | 036ac99eefed7fa923df2346bf27d3c06ede7d5f (diff) | |
download | php-git-80d552496cccce8c4253585ef5cb7b95d6824683.tar.gz |
Fix Bug, if parser input is not a filename (By Adam)
-rw-r--r-- | ext/dom/document.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 034b83f399..59a0aa5ce0 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -123,8 +123,14 @@ static void php_dom_ctx_error_level(int level, void *ctx, const char *msg) TSRMLS_FETCH(); parser = (xmlParserCtxtPtr) ctx; - php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line); + if (parser != NULL && parser->input != NULL) { + if (parser->input->filename) { + php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line); + } else { + php_error_docref(NULL TSRMLS_CC, level, "%s in Entity, line: %d", msg, parser->input->line); + } + } } /* }}} end php_dom_ctx_error */ |