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

Avoid fatal PHP error due to deprecation-warnings during autoloading.

Due to a PHP bug combined with deprecation-warnings from the OpenID
library, we may fail with a fatal error due to not finding the
SimpleSAML_Logger class.

See PHP bug: https://bugs.php.net/bug.php?id=47987

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2999 44740490-163a-0410-bde0-09ae8108e29a
parent a8eb5567
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,17 @@ set_exception_handler('SimpleSAML_exception_handler'); ...@@ -43,6 +43,17 @@ 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) {
if (!class_exists('SimpleSAML_Logger')) {
/* We are probably logging a deprecation-warning during parsing.
* Unfortunately, the autoloader is disabled at this point,
* so we should stop here.
*
* See PHP bug: https://bugs.php.net/bug.php?id=47987
*/
return FALSE;
}
if ($errno & SimpleSAML_Utilities::$logMask) { if ($errno & SimpleSAML_Utilities::$logMask) {
/* Masked error. */ /* Masked error. */
return FALSE; return FALSE;
......
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