Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13273 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42786 invoked by uid 1010); 12 Oct 2004 06:43:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42688 invoked from network); 12 Oct 2004 06:43:32 -0000 Received: from unknown (HELO bobsilva.com) (198.237.84.92) by pb1.pair.com with SMTP; 12 Oct 2004 06:43:32 -0000 Received: from [198.237.84.90] (account me HELO salty) by bobsilva.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 461092 for internals@lists.php.net; Mon, 11 Oct 2004 23:18:05 -0700 To: Date: Mon, 11 Oct 2004 23:44:08 -0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_004A_01C4AFEC.33733F30" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcSwJt+S6Lqxs/jnSvmP1E8AB3VEtw== Message-ID: Subject: [PATCH] Bug #30230 exception handler not working with objects From: junkmail@bobsilva.com ("Robert Silva") ------=_NextPart_000_004A_01C4AFEC.33733F30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit The problem is that set_exception_handler allows you to reset the handler by passing an empty string as argument. It did not check to make sure it was a string before checking strlen, therefore when passed an array, it assumed the user was resetting the handler. This patch only resets when an empty string is passed in (an array will set a new handler). Bob Silva ------=_NextPart_000_004A_01C4AFEC.33733F30 Content-Type: text/plain; name="bug_30230.diff.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="bug_30230.diff.txt" --- zend_builtin_functions.c 2004-10-11 23:04:15.000000000 -0700=0A= +++ zend_builtin_functions.c 2004-10-11 23:08:10.000000000 -0700=0A= @@ -1125,7 +1125,7 @@=0A= }=0A= ALLOC_ZVAL(EG(user_exception_handler));=0A= =0A= - if (Z_STRLEN_PP(exception_handler)=3D=3D0) { /* unset = user-defined handler */=0A= + if (Z_TYPE_PP(exception_handler) =3D=3D IS_STRING && = Z_STRLEN_PP(exception_handler)=3D=3D0) { /* unset user-defined handler */=0A= FREE_ZVAL(EG(user_exception_handler));=0A= EG(user_exception_handler) =3D NULL;=0A= RETURN_TRUE; ------=_NextPart_000_004A_01C4AFEC.33733F30--