chregu          Mon Dec  1 03:18:36 2003 EDT

  Modified files:              
    /php-src/ext/dom    document.c 
  Log:
  Fix Bug, if parser input is not a filename (By Adam)
  
  
Index: php-src/ext/dom/document.c
diff -u php-src/ext/dom/document.c:1.38 php-src/ext/dom/document.c:1.39
--- php-src/ext/dom/document.c:1.38     Sat Nov 29 15:40:17 2003
+++ php-src/ext/dom/document.c  Mon Dec  1 03:18:35 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: document.c,v 1.38 2003/11/29 20:40:17 rrichards Exp $ */
+/* $Id: document.c,v 1.39 2003/12/01 08:18:35 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -123,8 +123,14 @@
        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 */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to