My code for formatting a caught Ecxeption into a string is
Which is fine, but the stack trace appears in the getMessage() return.
Good for debugging.
But I have remote servers sending emails with this message format containing full addresses of files in the stack trace which is a potential security breach.
How do I prevent getMessage() returning the stack trace.
Code:
$this->message .= '<br>Exception thrown in '. '<br>File: '.basename($msg->getFile(),'.php'). '<br>Line: '.$msg->getLine(). '<br>Msge: '.$msg->getMessage(). '<br>Code: '.$msg->getCode(). '<br>------------------------------';
Good for debugging.
But I have remote servers sending emails with this message format containing full addresses of files in the stack trace which is a potential security breach.
How do I prevent getMessage() returning the stack trace.
Comment