#37532 [Opn->Bgs]: Allow override of Exception::getTrace()
| From: | helly@php.net | Date: | Fri, 19 May 2006 23:20:38 +0000 |
| Subject: | #37532 [Opn->Bgs]: Allow override of Exception::getTrace() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97395@lists.php.net to get a copy of this message | ||
ID: 37532
Updated by: helly@php.net
Reported By: spam01 at pornel dot net
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5.1.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Noone forces you to publish an exception on your websites. Indeed it is
recommended that you have display_errors off.
Check the internals@ archives why the exception members are final.
Previous Comments:
------------------------------------------------------------------------
[2006-05-19 22:59:43] spam01 at pornel dot net
Description:
------------
Exception::getTrace() is final. Because of that it's not possible to
override it in order to hide backtrace when it contains sensitive
data.
I'm developing library and I'd like to throw exceptions from sensitive
context without messing default handlers.
I realize that client's code is supposed to catch exceptions or disable
reporting, but I can't believe that everyone will RTFM and comply.
This issue also affects PDO. It would be nice if it could hide
passwords instead of just having this risk documented.
Reproduce code:
---------------
class StealthFoolproofException extends Exception
{
function getTrace() {return NULL;}
}
function test($secretpassword)
{
throw new StealthFoolproofException();
}
test('don\'t reveal that');
Expected result:
----------------
PHP Error: Fatal error: Uncaught exception StealthFoolproofException
... Stack trace: none.
Actual result:
--------------
Cannot override final method Exception::getTrace().
If not overriden, reveals arguments.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37532&edit=1