Skip to content
Snippets Groups Projects
Commit b4a2b0cf authored by Olav Morken's avatar Olav Morken
Browse files

_include.php: Limit the number of errors that will be logged.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1585 44740490-163a-0410-bde0-09ae8108e29a
parent 0f810a7a
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,13 @@ set_exception_handler('SimpleSAML_exception_handler'); ...@@ -32,6 +32,13 @@ set_exception_handler('SimpleSAML_exception_handler');
/* Log full backtrace on errors and warnings. */ /* Log full backtrace on errors and warnings. */
function SimpleSAML_error_handler($errno, $errstr, $errfile = NULL, $errline = 0, $errcontext = NULL) { function SimpleSAML_error_handler($errno, $errstr, $errfile = NULL, $errline = 0, $errcontext = NULL) {
static $limit = 5;
$limit -= 1;
if ($limit < 0) {
/* We have reached the limit in the number of backtraces we will log. */
return FALSE;
}
/* Show an error with a full backtrace. */ /* Show an error with a full backtrace. */
$e = new SimpleSAML_Error_Exception('Error ' . $errno . ' - ' . $errstr); $e = new SimpleSAML_Error_Exception('Error ' . $errno . ' - ' . $errstr);
$e->logError(); $e->logError();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment