diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-16 14:36:19 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-16 14:41:10 +0100 |
| commit | f761001c137f4d99ddc7fdcdc6687501d82106df (patch) | |
| tree | 17340bafcac1f3624cb2c3099c59ca6e3490e5b4 | |
| parent | 6af7f2af74c8249f3eebd83904a12850498b25f1 (diff) | |
prevent php8 warning, fixes #6166
Closes #6166
Merge request studip/studip!4672
| -rw-r--r-- | lib/phplib/Seminar_Perm.class.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/phplib/Seminar_Perm.class.php b/lib/phplib/Seminar_Perm.class.php index a116938..0fdce70 100644 --- a/lib/phplib/Seminar_Perm.class.php +++ b/lib/phplib/Seminar_Perm.class.php @@ -73,9 +73,9 @@ class Seminar_Perm { global $user; if (!$user_id) { - $user_id = $user->id; + $user_id = $user->id ?? null; } - if ($user_id && $user_id == $user->id) { + if ($user_id && $user && $user_id == $user->id) { return $user->perms; } if ($user_id && isset($this->studip_perms['studip'][$user_id])) { @@ -83,10 +83,7 @@ class Seminar_Perm } if ($user_id && $user_id !== 'nobody') { $query = "SELECT perms FROM auth_user_md5 WHERE user_id = :user_id"; - $statement = DBManager::get()->prepare($query); - $statement->bindValue(':user_id', $user_id); - $statement->execute(); - $perms = $statement->fetchColumn(); + $perms = DBManager::get()->fetchColumn($query, [':user_id' => $user_id]); return $this->studip_perms['studip'][$user_id] = $perms; } |
