From 24acec251533df3a1257d8b982e55a37b6dd6ede Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Wed, 7 Aug 2024 14:38:04 +0000
Subject: [PATCH] check callback for string type before validating method,
 fixes #4442

Closes #4442

Merge request studip/studip!3249
---
 lib/classes/auth_plugins/StudipAuthAbstract.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/classes/auth_plugins/StudipAuthAbstract.php b/lib/classes/auth_plugins/StudipAuthAbstract.php
index e701c3310b6..c394952d690 100644
--- a/lib/classes/auth_plugins/StudipAuthAbstract.php
+++ b/lib/classes/auth_plugins/StudipAuthAbstract.php
@@ -467,7 +467,7 @@ class StudipAuthAbstract
         if ($user && is_array($this->user_data_mapping)) {
             foreach ($this->user_data_mapping as $key => $value) {
                 $callback = null;
-                if (method_exists($this, $value['callback'])) {
+                if (is_string($value['callback']) && method_exists($this, $value['callback'])) {
                     $callback = [$this, $value['callback']];
                 } else if (is_callable($value['callback'])) {
                     $callback = $value['callback'];
-- 
GitLab