diff --git a/config-templates/config.php b/config-templates/config.php index d46c1ffc6ec58d0fb26c507c4bf050779f7561bf..170bbe960cbc4bbaf20c8b440c9f3186caf72532 100644 --- a/config-templates/config.php +++ b/config-templates/config.php @@ -237,9 +237,8 @@ $config = [ * SAML messages will be logged, including plaintext versions of encrypted * messages. * - * - 'backtraces': this action controls the logging of error backtraces. If you - * want to log backtraces so that you can debug any possible errors happening in - * SimpleSAMLphp, enable this action (add it to the array or set it to true). + * - 'backtraces': this action controls the logging of error backtraces so you + * can debug any possible errors happening in SimpleSAMLphp. * * - 'validatexml': this action allows you to validate SAML documents against all * the relevant XML schemas. SAML 1.1 messages or SAML metadata parsed with diff --git a/lib/SimpleSAML/Error/Exception.php b/lib/SimpleSAML/Error/Exception.php index b0b7b8809bd0c94ae1c213dd2abb42edf5a601b4..df7ed1a52e5ce59dbd002498b81c44470a6a51ec 100644 --- a/lib/SimpleSAML/Error/Exception.php +++ b/lib/SimpleSAML/Error/Exception.php @@ -204,18 +204,9 @@ class Exception extends \Exception */ protected function logBacktrace($level = Logger::DEBUG) { - // see if debugging is enabled for backtraces - $debug = Configuration::getInstance()->getArrayize('debug', ['backtraces' => false]); - - if ( - !(in_array('backtraces', $debug, true) // implicitly enabled - || (array_key_exists('backtraces', $debug) - && $debug['backtraces'] === true) - // explicitly set - // TODO: deprecate the old style and remove it in 2.0 - || (array_key_exists(0, $debug) - && $debug[0] === true)) // old style 'debug' configuration option - ) { + // Do nothing if backtraces have been disabled in config. + $debug = Configuration::getInstance()->getArrayize('debug', ['backtraces' => true]); + if (array_key_exists('backtraces', $debug) && $debug['backtraces'] === false) { return; }