chregu Wed Aug 25 04:27:07 2004 EDT
Modified files:
/php-src/ext/dom document.c
Log:
if $doc->recover = true; set error_reporting to (old | E_WARNING)
This way, you can't silence XML parse errors with the @ character
http://cvs.php.net/diff.php/php-src/ext/dom/document.c?r1=1.57&r2=1.58&ty=u
Index: php-src/ext/dom/document.c
diff -u php-src/ext/dom/document.c:1.57 php-src/ext/dom/document.c:1.58
--- php-src/ext/dom/document.c:1.57 Fri Aug 13 08:32:55 2004
+++ php-src/ext/dom/document.c Wed Aug 25 04:27:07 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: document.c,v 1.57 2004/08/13 12:32:55 chregu Exp $ */
+/* $Id: document.c,v 1.58 2004/08/25 08:27:07 chregu Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1436,6 +1436,7 @@
php_libxml_ref_obj *document = NULL;
int validate, recover, resolve_externals, keep_blanks, substitute_ent;
int resolved_path_len;
+ int old_error_reporting;
char *directory=NULL, resolved_path[MAXPATHLEN];
if (id != NULL) {
@@ -1510,11 +1511,17 @@
ctxt->sax->error = php_libxml_ctx_error;
ctxt->sax->warning = php_libxml_ctx_warning;
}
-
+ if (recover) {
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) = old_error_reporting | E_WARNING;
+ }
xmlParseDocument(ctxt);
if (ctxt->wellFormed || recover) {
ret = ctxt->myDoc;
+ if (recover) {
+ EG(error_reporting) = old_error_reporting;
+ }
/* If loading from memory, set the base reference uri for the document
*/
if (ret->URL == NULL && ctxt->directory != NULL) {
ret->URL = xmlStrdup(ctxt->directory);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php