X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/088bd1dcb2d2fb223354957e4307b4802ff25442..f0d3831f12a6588adc7aaa9f428150c9d8d3ff3f:/vendor/plugins/http_accept_language/lib/http_accept_language.rb diff --git a/vendor/plugins/http_accept_language/lib/http_accept_language.rb b/vendor/plugins/http_accept_language/lib/http_accept_language.rb index 1bedd6c74..1266a3e64 100644 --- a/vendor/plugins/http_accept_language/lib/http_accept_language.rb +++ b/vendor/plugins/http_accept_language/lib/http_accept_language.rb @@ -49,7 +49,7 @@ module HttpAcceptLanguage def compatible_language_from(array) user_preferred_languages.map do |x| array.find do |y| - y.to_s =~ /^#{x.to_s}(-|$)/ + y.to_s =~ /^#{Regexp.escape(x.to_s)}(-|$)/ end end.compact.first end