Skip to content

Commit

Permalink
Bug fix in saving custom icon in auth_oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
weilai-irl committed Feb 21, 2025
1 parent 8bd25cd commit 1b5e2a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auth/oidc/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion auth/oidc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1b5e2a9

Please sign in to comment.