From af5617cc474108bb957ec9707d616c14fb7402ae Mon Sep 17 00:00:00 2001 From: ooooooo-q Date: Mon, 10 Jan 2022 19:51:52 +0900 Subject: [PATCH] fix redos --- lib/i18n/interpolate/ruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/i18n/interpolate/ruby.rb b/lib/i18n/interpolate/ruby.rb index 13171d30..7a964659 100644 --- a/lib/i18n/interpolate/ruby.rb +++ b/lib/i18n/interpolate/ruby.rb @@ -5,7 +5,7 @@ module I18n DEFAULT_INTERPOLATION_PATTERNS = [ /%%/, /%\{([\w|]+)\}/, # matches placeholders like "%{foo} or %{foo|word}" - /%<(\w+)>(.*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%.d" + /%<(\w+)>([^\d]*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%.d" ].freeze INTERPOLATION_PATTERN = Regexp.union(DEFAULT_INTERPOLATION_PATTERNS) deprecate_constant :INTERPOLATION_PATTERN