Skip to content

Commit

Permalink
Work around ReDoS vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Mar 4, 2022
1 parent 44ea196 commit d073c4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generators/rails_admin/importmap_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def format

# Tidy up jQuery UI dependencies
jquery_uis = imports.keys.filter { |key, _| key =~ /jquery-ui/ }
imports['jquery-ui/'] = imports[jquery_uis.first].gsub(%r{(/[^@]+)+$}, '/')
imports['jquery-ui/'] = imports[jquery_uis.first].gsub(%r{(@[^/@]+)/[^@]+$}, '\1/')
imports.reject! { |key, _| jquery_uis.include? key }

pins = ['pin "rails_admin", preload: true', packager.pin_for('rails_admin/src/rails_admin/base', imports.delete('rails_admin'))]
Expand Down

0 comments on commit d073c4d

Please sign in to comment.