From e0f7e38e843ff19e7c50da18584d644867f9ae82 Mon Sep 17 00:00:00 2001 From: frytimo Date: Thu, 16 Oct 2025 15:08:19 -0300 Subject: [PATCH] Fix missing CSS class for open_id banners and more PHP warnings (#7575) * Fix PHP 8.4 warnings Strings are no longer allowed to be defaulted to null without the null declaration * Fix missing css class for open_id banners --- .../resources/classes/plugins/database.php | 13 +++++++------ resources/classes/settings.php | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/authentication/resources/classes/plugins/database.php b/core/authentication/resources/classes/plugins/database.php index 19637f5551..9352e9b9f6 100644 --- a/core/authentication/resources/classes/plugins/database.php +++ b/core/authentication/resources/classes/plugins/database.php @@ -131,7 +131,8 @@ class plugin_database { if (class_exists($open_id_class)) { $banners[] = [ 'name' => $open_id_class, - 'image' => $open_id_class::get_banner_image(), + 'image' => $open_id_class::get_banner_image($settings), + 'class' => $open_id_class::get_banner_css_class($settings), 'url' => '/app/open_id/open_id.php?action=' . $open_id_class, ]; } @@ -259,7 +260,7 @@ class plugin_database { else { //deprecated - compare the password provided by the user with the one in the database if (md5($row["salt"].$this->password) === $row["password"]) { - $row["password"] = crypt($this->password, '$1$'.$password_salt.'$'); + $row["password"] = crypt($this->password, '$1$'.$row['salt'].'$'); $valid_password = true; } } @@ -304,10 +305,10 @@ class plugin_database { $parameters['domain_uuid'] = $this->domain_uuid; $parameters['contact_uuid'] = $this->contact_uuid; $contact = $settings->database()->select($sql, $parameters, 'row'); - $this->contact_organization = $contact['contact_organization']; - $this->contact_name_given = $contact['contact_name_given']; - $this->contact_name_family = $contact['contact_name_family']; - $this->contact_image = $contact['contact_attachment_uuid']; + $this->contact_organization = $contact['contact_organization'] ?? ''; + $this->contact_name_given = $contact['contact_name_given'] ?? ''; + $this->contact_name_family = $contact['contact_name_family'] ?? ''; + $this->contact_image = $contact['contact_attachment_uuid'] ?? ''; } //debug info diff --git a/resources/classes/settings.php b/resources/classes/settings.php index 6821431844..29be1c9aff 100644 --- a/resources/classes/settings.php +++ b/resources/classes/settings.php @@ -142,11 +142,11 @@ class settings implements clear_cache { /** * Get the value utilizing the hierarchical overriding technique - * @param string $category Returns all settings when empty or the default value if the settings array is null - * @param string $subcategory Returns the array of category items when empty or the default value if the category array is null + * @param string|null $category Returns all settings when empty or the default value if the settings array is null + * @param string|null $subcategory Returns the array of category items when empty or the default value if the category array is null * @param mixed $default_value allows default value returned if category and subcategory not found */ - public function get(string $category = null, string $subcategory = null, $default_value = null) { + public function get(?string $category = null, ?string $subcategory = null, $default_value = null) { //incremental refinement from all settings to a single setting if (empty($category)) {