diff --git a/auth/oidc/lib.php b/auth/oidc/lib.php index 8f3b71691..482060daa 100644 --- a/auth/oidc/lib.php +++ b/auth/oidc/lib.php @@ -98,7 +98,7 @@ function auth_oidc_initialize_customicon($filefullname) { $fullpath = "/{$systemcontext->id}/auth_oidc/customicon/0{$file}"; $fs = get_file_storage(); - if (!$file = $fs->get_file_by_hash(sha1($fullpath)) || $file->is_directory()) { + if (!($file = $fs->get_file_by_hash(sha1($fullpath))) || $file->is_directory()) { return false; } $pixpluginsdir = 'pix_plugins/auth/oidc/0'; diff --git a/auth/oidc/settings.php b/auth/oidc/settings.php index 54b3fbe40..8622ca4ec 100644 --- a/auth/oidc/settings.php +++ b/auth/oidc/settings.php @@ -226,7 +226,8 @@ $configkey = new lang_string('cfg_customicon_key', 'auth_oidc'); $configdesc = new lang_string('cfg_customicon_desc', 'auth_oidc'); $customiconsetting = new admin_setting_configstoredfile('auth_oidc/customicon', - get_string('cfg_customicon_key', 'auth_oidc'), get_string('cfg_customicon_desc', 'auth_oidc'), 'customicon'); + get_string('cfg_customicon_key', 'auth_oidc'), get_string('cfg_customicon_desc', 'auth_oidc'), 'customicon', 0, + ['accepted_types' => ['.png', '.jpg', '.ico'], 'maxbytes' => get_max_upload_file_size()]); $customiconsetting->set_updatedcallback('auth_oidc_initialize_customicon'); $settings->add($customiconsetting);