From 610edb25e265887fc048f16bf8c1adc05c2adebb Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Fri, 8 Dec 2017 15:30:37 +0100
Subject: [PATCH] Fix bug in createLoggingHandler

Fixes edge-case https://github.com/simplesamlphp/simplesamlphp/issues/741 where application has one of the known LoggingHandlers' name as a defined class
---
 lib/SimpleSAML/Logger.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php
index 8c121bbb9..a383addbd 100644
--- a/lib/SimpleSAML/Logger.php
+++ b/lib/SimpleSAML/Logger.php
@@ -373,7 +373,7 @@ class Logger
             $handler = $config->getString('logging.handler', 'syslog');
         }
 
-        if (class_exists($handler)) {
+        if (!array_key_exists($handler, $known_handlers) && class_exists($handler)) {
             if (!in_array('SimpleSAML\Logger\LoggingHandlerInterface', class_implements($handler), true)) {
                 throw new \Exception("The logging handler '$handler' is invalid.");
             }
-- 
GitLab