From 5c507c974abbc3cbd60ed708bd2ae4108c376edf Mon Sep 17 00:00:00 2001 From: Nuzair46 Date: Tue, 15 Jul 2025 14:25:24 +0900 Subject: [PATCH] Security/Fix CodeQl warnings --- lib/config/integrations/heroku.rb | 2 +- lib/config/options.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/integrations/heroku.rb b/lib/config/integrations/heroku.rb index 914893a6..b7272fb0 100644 --- a/lib/config/integrations/heroku.rb +++ b/lib/config/integrations/heroku.rb @@ -26,7 +26,7 @@ def vars end def environment - heroku("run 'echo $RAILS_ENV'").chomp[/(\w+)\z/] + heroku("run 'echo $RAILS_ENV'").chomp[/(?>\w+)\z/] end def heroku(command) diff --git a/lib/config/options.rb b/lib/config/options.rb index 07944b73..cba24bd1 100644 --- a/lib/config/options.rb +++ b/lib/config/options.rb @@ -150,7 +150,7 @@ def has_key?(key) end def method_missing(method_name, *args) - if Config.fail_on_missing && method_name !~ /.*(?==\z)/m + if Config.fail_on_missing && !method_name.to_s.end_with?('=') raise KeyError, "key not found: #{method_name.inspect}" unless key?(method_name) end super