diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-01-03 20:22:04 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-01-04 14:13:12 +0100 |
commit | 09e1bbfee2f997261d24acb37d95bdb638467c02 (patch) | |
tree | c56e7b931edb0c918f8cc8f8c10e5435338fd46e /Bugzilla/Config.pm | |
parent | 51605fb0ae3ce7d85b6037e0ac4b22676766ad0c (diff) | |
download | bugzilla-09e1bbfee2f997261d24acb37d95bdb638467c02.tar.gz bugzilla-09e1bbfee2f997261d24acb37d95bdb638467c02.tar.xz |
Bug 1426409 - github_secret key has no rate limiting
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r-- | Bugzilla/Config.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index f93992f91..d050ff9e0 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -193,6 +193,20 @@ sub update_params { $param->{$name} = $item->{'default'}; } } + else { + my $checker = $item->{'checker'}; + my $updater = $item->{'updater'}; + if ($checker) { + my $error = $checker->($param->{$name}, $item); + if ($error && $updater) { + my $new_val = $updater->( $param->{$name} ); + $param->{$name} = $new_val unless $checker->($new_val, $item); + } + elsif ($error) { + warn "Invalid parameter: $name\n"; + } + } + } } # Generate unique Duo integration secret key |