Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26297 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12676 invoked by uid 1010); 3 Nov 2006 11:51:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12661 invoked from network); 3 Nov 2006 11:51:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2006 11:51:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=nsabbi@officinedigitali.it; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nsabbi@officinedigitali.it; sender-id=unknown Received-SPF: error (pb1.pair.com: domain officinedigitali.it from 194.244.215.2 cause and error) X-PHP-List-Original-Sender: nsabbi@officinedigitali.it X-Host-Fingerprint: 194.244.215.2 mail1.netscalibur.it Solaris 8 (1) Received: from [194.244.215.2] ([194.244.215.2:63567] helo=mail2.netscalibur.it) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/9F-06002-95D2B454 for ; Fri, 03 Nov 2006 06:51:54 -0500 Received: from [192.168.0.197] (213.174.161.132) by mail2.netscalibur.it (7.0.027) (authenticated as nsabbi@officinedigitali.it) id 454A2EFF00015900 for internals@lists.php.net; Fri, 3 Nov 2006 12:51:47 +0100 Message-ID: <454B2D25.1070304@officinedigitali.it> Date: Fri, 03 Nov 2006 12:51:01 +0100 User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/mixed; boundary="------------020407000208010802040504" Subject: [PATCH] don't override error_reporting() in module dom From: nsabbi@officinedigitali.it (Nico Sabbi) --------------020407000208010802040504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, this patch removes the prevaricative code in ext/dom/document.c that forcibly reports errors in xml data overriding the error_reporting value set by the user. If the user intentionally sets $dom->recover to true and disables E_WARNING he obviously wants php to shut up in all cases, even when the xml fed to dom is broken; php should obediently comply, not take initiatives on its own accord. Please, consider this patch for inclusion in HEAD. Nico --------------020407000208010802040504 Content-Type: text/x-patch; name="dom.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dom.diff" --- 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); --------------020407000208010802040504--