[PATCH] Bug #30230 exception handler not working with objects

php.internals

Robert Silva

21 years ago
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

Andi Gutmans

21 years ago
I must admit that I think it's kind of ugly to be able to reset it by using "" but as this seems to be the existing behavior (I guess the person that added the callable support missed this part), I'll apply the patch. Thanks, Andi At 11:44 PM 10/11/2004 -0700, Robert Silva wrote:

Andi Gutmans

21 years ago
I see Marcus has already attempted to fix this even though the bug report is still open. Marcus, what exactly did you do? It seems you allow only NULL to reset exception handler and not empty string. Right? So it seems like you agree with me that "" is ugly but the question is if we're breaking something now. It's probably early enough in the game to do so. Andi At 11:44 PM 10/11/2004 -0700, Robert Silva wrote:

Jason Garber

21 years ago
Hello Andi, reset_exception_handler() :)
-- Best regards, Jason mailto:jason@ionzoft.com Tuesday, October 12, 2004, 5:40:34 PM, you wrote: AG> I see Marcus has already attempted to fix this even though the bug report AG> is still open. AG> Marcus, what exactly did you do? It seems you allow only NULL to reset AG> exception handler and not empty string. Right? AG> So it seems like you agree with me that "" is ugly but the question is if AG> we're breaking something now. AG> It's probably early enough in the game to do so. AG> Andi AG> At 11:44 PM 10/11/2004 -0700, Robert Silva wrote: