Skip to content

Commit

Permalink
Fixes #38126 - Check better for parent option desc injection
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren committed Jan 17, 2025
1 parent 11aa069 commit 9e2a61d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hammer_cli/options/option_family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(options = {})
def description
types = all.map(&:type).map { |s| s.split('_').last.to_s }
.map(&:downcase).join('/')
parent_desc = @parent.help[1].gsub(IDS_REGEX) { |w| w.gsub(/\b.+\b/, types) }
parent_desc = @parent.help[1].gsub(IDS_REGEX) { |w| types.include?(w.strip.downcase) ? w.gsub(/\b.+\b/, types) : w }
desc = @options[:description] || parent_desc.strip.empty? ? @options[:description] : parent_desc
if @options[:deprecation].class <= String
format_deprecation_msg(desc, _('Deprecated: %{deprecated_msg}') % { deprecated_msg: @options[:deprecation] })
Expand Down

0 comments on commit 9e2a61d

Please sign in to comment.