From 4e649e055ccb051e74ddfbf7bc439b5a3c457c76 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Sun, 30 Aug 2015 21:33:28 +0200 Subject: [PATCH] Throw an exception instead of doing nothing if the auth source specified is invalid. This mimics the old behaviour. --- lib/SimpleSAML/Auth/Default.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php index 5dfa1b8f8..76b7f3989 100644 --- a/lib/SimpleSAML/Auth/Default.php +++ b/lib/SimpleSAML/Auth/Default.php @@ -21,9 +21,10 @@ class SimpleSAML_Auth_Default { array $params = array()) { $as = SimpleSAML_Auth_Source::getById($authId); - if ($as !== null) { - $as->initLogin($return, $errorURL, $params); + if ($as === null) { + throw new Exception('Invalid authentication source: ' . $authId); } + $as->initLogin($return, $errorURL, $params); } -- GitLab