diff --git a/config-templates/config.php b/config-templates/config.php index acefbb4b086e8584fcd4e0f42393fb839907768e..b573f432d8ce2bea2a3961d5ed173342b91caac6 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 edf708b169e806916c52eadeecd383a4b1473b32..da53562d19b2ff06afca652a831bf1a55dfae08d 100644 --- a/lib/SimpleSAML/Error/Exception.php +++ b/lib/SimpleSAML/Error/Exception.php @@ -201,18 +201,9 @@ class Exception extends \Exception */ protected function logBacktrace(int $level = Logger::DEBUG): void { - // 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; }