Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27963 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21757 invoked by uid 1010); 9 Feb 2007 20:33:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21742 invoked from network); 9 Feb 2007 20:33:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2007 20:33:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=christian.stocker@bitflux.ch; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christian.stocker@bitflux.ch; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bitflux.ch from 212.55.202.210 cause and error) X-PHP-List-Original-Sender: christian.stocker@bitflux.ch X-Host-Fingerprint: 212.55.202.210 host-210.bitflux.ch Linux 2.5 (sometimes 2.4) (4) Received: from [212.55.202.210] ([212.55.202.210:49893] helo=devel.bitflux.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/62-03629-49ADCC54 for ; Fri, 09 Feb 2007 15:33:25 -0500 Received: from localhost (localhost [127.0.0.1]) by devel.bitflux.ch (Postfix) with ESMTP id EB7FDE74CB; Fri, 9 Feb 2007 21:33:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at devel.bitflux.ch Received: from devel.bitflux.ch ([127.0.0.1]) by localhost (devel.bitflux.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DKASS7HM-h1b; Fri, 9 Feb 2007 21:33:11 +0100 (CET) Received: from [192.168.1.127] (80-218-228-232.dclient.hispeed.ch [80.218.228.232]) by devel.bitflux.ch (Postfix) with ESMTP id 61E99E74B3; Fri, 9 Feb 2007 21:33:10 +0100 (CET) Message-ID: <45CCDA75.9020404@bitflux.ch> Date: Fri, 09 Feb 2007 21:32:53 +0100 Organization: Bitflux GmbH User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061128) MIME-Version: 1.0 To: Nico Sabbi CC: internals@lists.php.net References: <45CC1984.6010304@pooteeweet.org> <45CCAAF3.2030806@officinedigitali.it> In-Reply-To: <45CCAAF3.2030806@officinedigitali.it> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: DOM recover error reporting mode (was: [PHP-DEV] todo items) From: christian.stocker@bitflux.ch (Christian Stocker) On 9.2.2007 18:10 Uhr, Nico Sabbi wrote: > > may I re-propose the attached patch? The first time it was ignored, but > the current behaviour of > dom module is extremely annoying Completely out of context your post, but I was the one who wrote that part of code, since I was more or less forced to implement it the way it is. I'm fine with removing it, but there were big objections against the whole recover stuff back then when I committed it, so the way it works currently was some kind of compromise See also: http://blog.bitflux.ch/archive/2004/08/13/parsing_non_well_formed_xml_documents_in_php.html http://blog.bitflux.ch/archive/2004/08/20/parsing_non_well_formed_xml_documents_considered_harmful.html and don't forget the comments :) Unfortunately, I couldn't find the posts regarding this matter in the archives. chregu > > > ------------------------------------------------------------------------ > > --- ext/dom/document.c.orig 2006-01-01 13:50:06.000000000 +0100 > +++ ext/dom/document.c 2006-11-03 10:53:18.000000000 +0100 > @@ -1512,18 +1512,11 @@ > #endif > > ctxt->recovery = recover; > - 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 (ctxt->recovery) { > - 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); > > > -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | christian.stocker@bitflux.ch | GPG 0x5CE1DECB