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 */