Skip to content

Commit

Permalink
Merge pull request #600 from ooooooo-q/master
Browse files Browse the repository at this point in the history
fix ReDoS
  • Loading branch information
radar committed Jan 26, 2022
2 parents b48b0bc + af5617c commit d763372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/i18n/interpolate/ruby.rb
Expand Up @@ -5,7 +5,7 @@ module I18n
DEFAULT_INTERPOLATION_PATTERNS = [
/%%/,
/%\{([\w|]+)\}/, # matches placeholders like "%{foo} or %{foo|word}"
/%<(\w+)>(.*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%<foo>.d"
/%<(\w+)>([^\d]*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%<foo>.d"
].freeze
INTERPOLATION_PATTERN = Regexp.union(DEFAULT_INTERPOLATION_PATTERNS)
deprecate_constant :INTERPOLATION_PATTERN
Expand Down

0 comments on commit d763372

Please sign in to comment.